1 / 6

Statistical Software

Statistical Software. An introduction to Statistics Using R. Instructed by Jinzhu Jia. Chap 3. 概率与分布. 参考书目: R 语言与统计分析 (汤银才) 随机抽样的实现 常用 的概率分布及其数字特征 R 中的内嵌分布. 随机抽样. 用 R 做简单随机模拟。 ( 1 ) 硬币是均匀的么 ? X = sample(c('H','T'),100,replace = T) ( 2 ) 从 54 张扑克随机抽取 13 张,问取到炸弹的几率是多少 ?

Download Presentation

Statistical Software

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Statistical Software An introduction to Statistics Using R Instructed by Jinzhu Jia

  2. Chap 3. 概率与分布 • 参考书目:R 语言与统计分析 (汤银才) • 随机抽样的实现 • 常用的概率分布及其数字特征 • R中的内嵌分布

  3. 随机抽样 • 用R做简单随机模拟。 (1)硬币是均匀的么? X = sample(c('H','T'),100,replace = T) (2)从54张扑克随机抽取13张,问取到炸弹的几率是多少? sample(c(paste('S',1:13,sep=''),paste('H',1:13,sep=''),paste('C',1:13,sep=''),paste('D',1:13,sep=''),c('J1','J2')),20) 剩余部分留为作业。 (3)不等概抽样。 例: sample(c(0,1),100,prob = c(0.1,0.9))

  4. 排列组合 • 从52张扑克牌中任取4张,其为炸弹的概率是多少? 答: > 13/choose(52,4)

  5. 概率分布 • >?distribution • dXXX (density/mass function) > dnorm(x) = (x) = • pXXX (CDF, 分布函数) >pnorm(x) = P(X<=x) • qXXX(quntile,分位数) >qnorm(x) = 等价的, CDF(qnorm(x)) = x • rXXX(random, 随机数的产生) >rnorm(n),产生n个i.i.d. 标准正态分布的随机数。

  6. 中心极限定理 • i.i.d., • 有 • 用 R 直观验证中心极限定理 • n 取 1,3,10,30 • Xi ~ U(0,1)

More Related