日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
創(chuàng)新互聯(lián)R語言教程:R語言標(biāo)準(zhǔn)分布

在來自獨(dú)立源的數(shù)據(jù)的隨機(jī)集合中,通常觀察到數(shù)據(jù)的分布是正常的。 這意味著,在繪制水平軸上的變量值和垂直軸上的值的計(jì)數(shù)的圖形時(shí),我們得到鐘形曲線。 曲線的中心表示數(shù)據(jù)集的平均值。 在圖中,50%的值位于平均值的左側(cè),另外50%位于圖表的右側(cè)。 這在統(tǒng)計(jì)學(xué)中被稱為正態(tài)分布。

r語言有四個(gè)內(nèi)置函數(shù)來產(chǎn)生正態(tài)分布。 它們描述如下。

dnorm(x, mean, sd)
pnorm(x, mean, sd)
qnorm(p, mean, sd)
rnorm(n, mean, sd)

以下是在上述功能中使用的參數(shù)的描述 - 

  • x是數(shù)字的向量。
  • p是概率的向量。
  • n是觀察的數(shù)量(樣本大?。?。
  • mean是樣本數(shù)據(jù)的平均值。 它的默認(rèn)值為零。
  • sd是標(biāo)準(zhǔn)偏差。 它的默認(rèn)值為1。

dnorm()

該函數(shù)給出給定平均值和標(biāo)準(zhǔn)偏差在每個(gè)點(diǎn)的概率分布的高度。

# Create a sequence of numbers between -10 and 10 incrementing by 0.1.
x <- seq(-10, 10, by = .1)

# Choose the mean as 2.5 and standard deviation as 0.5.
y <- dnorm(x, mean = 2.5, sd = 0.5)

# Give the chart file a name.
png(file = "dnorm.png")

plot(x,y)

# Save the file.
dev.off()

當(dāng)我們執(zhí)行上面的代碼,它產(chǎn)生以下結(jié)果 -

pnorm()

該函數(shù)給出正態(tài)分布隨機(jī)數(shù)的概率小于給定數(shù)的值。 它也被稱為“累積分布函數(shù)”。

# Create a sequence of numbers between -10 and 10 incrementing by 0.2.
x <- seq(-10,10,by = .2)
 
# Choose the mean as 2.5 and standard deviation as 2. 
y <- pnorm(x, mean = 2.5, sd = 2)

# Give the chart file a name.
png(file = "pnorm.png")

# Plot the graph.
plot(x,y)

# Save the file.
dev.off()

當(dāng)我們執(zhí)行上面的代碼,它產(chǎn)生以下結(jié)果 -

qnorm()

該函數(shù)采用概率值,并給出累積值與概率值匹配的數(shù)字。

# Create a sequence of probability values incrementing by 0.02.
x <- seq(0, 1, by = 0.02)

# Choose the mean as 2 and standard deviation as 3.
y <- qnorm(x, mean = 2, sd = 3)

# Give the chart file a name.
png(file = "qnorm.png")

# Plot the graph.
plot(x,y)

# Save the file.
dev.off()

當(dāng)我們執(zhí)行上面的代碼,它產(chǎn)生以下結(jié)果 -

RNORM()

此函數(shù)用于生成分布正常的隨機(jī)數(shù)。 它將樣本大小作為輸入,并生成許多隨機(jī)數(shù)。 我們繪制一個(gè)直方圖來顯示生成的數(shù)字的分布。

# Create a sample of 50 numbers which are normally distributed.
y <- rnorm(50)

# Give the chart file a name.
png(file = "rnorm.png")

# Plot the histogram for this sample.
hist(y, main = "Normal DIstribution")

# Save the file.
dev.off()

當(dāng)我們執(zhí)行上面的代碼,它產(chǎn)生以下結(jié)果 -


分享題目:創(chuàng)新互聯(lián)R語言教程:R語言標(biāo)準(zhǔn)分布
當(dāng)前鏈接:http://www.dlmjj.cn/article/dhigcpp.html