美文网首页
PH525x series - -Introduction t

PH525x series - -Introduction t

作者: 3between7 | 来源:发表于2019-11-13 15:38 被阅读0次

一、随机变量

累积分布函数(Cumulative Distribution Function,CDF)

  • CDF定义:

F(\alpha)≡ Pr(x ≤ \alpha)

即:所有小于等于\alpha的可能值的概率和就是\alpha的CDF

  • Histograms
#hist函数,可用来绘制分布柱状图
     hist(x, breaks = "Sturges",
          freq = NULL, probability = !freq,
          include.lowest = TRUE, right = TRUE,
          density = NULL, angle = 45, col = NULL, border = NULL,
          main = paste("Histogram of" , xname),
          xlim = range(breaks), ylim = NULL,
          xlab = xname, ylab,
          axes = TRUE, plot = TRUE, labels = FALSE,
          nclass = NULL, warn.unused = TRUE, ...)

概率分布(Probability Distribution)

  • 概率分布定义

Pr(\alpha ≤ b ) = F(b) - F(\alpha)

  • 正态分布(Normal Distribution,又名Gaussian distribution)

Pr(\alpha < x < b ) = ∫_\alpha^b 1/\sqrt{2πσ^2} exp(-(x-μ)^2/2σ^2)dx

在R中,对应的正态分布函数为pnorm,相关参数如下:

pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
#mean 对应正态分布数学公式中的μ;sd对应σ
#当lower.tail=T时,返回P[X ≤ q]的概率


相关文章

网友评论

      本文标题:PH525x series - -Introduction t

      本文链接:https://www.haomeiwen.com/subject/znytictx.html