Re: [問題] 請問R怎麼畫theoretical distribution?
※ 引述《wesley123 (想睡覺...)》之銘言:
: Draw 100 random numbers from each of the following distribution.
: Compute the sample mean...(略) Finally, draw the histogram of the samples
: along with the theoretical distribution.
: 我想請問theoretical distribution用R要怎麼畫啊?
: sample data的很簡單我會
: theoretical的應該也很簡單吧 但是我真的不知道怎麼畫 ...
: introduction to R 有找過但是找不到
: 我今天是第一次用R這個軟體
: 還請各位前輩幫幫忙 謝謝!!
參考一下我的想法
有更好方法也請大家提出
# Generate 100 r.s.from specific distribution(e.g. Normal(0,1)) and
draw histogram of the sample
hist(rnorm(100),freq=F)
# Draw density function for the theoretical distribution
points(seq(-3,3,l=101),dnorm(seq(-3,3,l=101)),type="l",col=2,lwd=2)
--
N家的夢: SWM ED VR IF Aspherical
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.165.189.92
※ 編輯: neoism 來自: 218.165.189.92 (04/03 15:48)
討論串 (同標題文章)