Lecture6:统计推断中的Monte Carlo方法 张伟平 Monday 12th October,2009
Lecture 6: ⁄Ỏ•Monte Carlo ê{ ‹ï² Monday 12th October, 2009
Contents 1 Monte Carlo Methods in Inference 1 1.1 Monte Carlo Methods for Estimation............. 1.1.1 Monte Carlo Estimation and Standard Error ... 1.l.2 Estimation of MSE...................5 l.2 Estimating a confidence level··.··.·····.····· 10 l.3 Monte Carlo Methods for Hypothesis Tests·········l6 l.4 Empirical Type I error rate.··.·····.······· 17 1.4.1 Power of a Test.·.··..·.·.···...···24 l.4.2 Power Comparisons··· 30 1.5 Application:"Count Five"Test for Equal Variance ....34 Previous Next First Last Back Forward 1
Contents 1 Monte Carlo Methods in Inference 1 1.1 Monte Carlo Methods for Estimation . . . . . . . . . . . . . 1 1.1.1 Monte Carlo Estimation and Standard Error . . . . 2 1.1.2 Estimation of MSE . . . . . . . . . . . . . . . . . . . 5 1.2 Estimating a confidence level . . . . . . . . . . . . . . . . . 10 1.3 Monte Carlo Methods for Hypothesis Tests . . . . . . . . . 16 1.4 Empirical Type I error rate . . . . . . . . . . . . . . . . . . 17 1.4.1 Power of a Test . . . . . . . . . . . . . . . . . . . . . 24 1.4.2 Power Comparisons . . . . . . . . . . . . . . . . . . 30 1.5 Application: “Count Five” Test for Equal Variance . . . . . 34 Previous Next First Last Back Forward 1
Chapter 1 Monte Carlo Methods in Inference Monte Carlo方法可以指统计推断或者数值分析中任何使用随机数模拟的方 法.本章我们讨论一些统计推断中的Monte Carlo方法.Monte Carlo方法可 以用于估计统计量分布中的参数,均方误差,分位数等,也可以用于估计置信 区间覆盖真实参数的概率(置信水平),假设检验中检验的一型错误率,功效等 等 1.1 Monte Carlo Methods for Estimation 假设X1,,X为从总体X中抽取的随机样本,参数的估计量记为 a=X1,…,Xn) Previous Next First Last Back Forward
Chapter 1 Monte Carlo Methods in Inference Monte Carloê{å±ç⁄Ỏ½ˆÍ䩤•?¤¶^ëÅÍ[ê {. Ÿ ·Ç?ÿò ⁄Ỏ•Monte Carloê{. Monte Carloê{å ±^uO⁄O˛©Ÿ •ÎÍ, ˛êÿ, ©†Í, èå±^uOò& ´mCX˝¢ÎÍV«(ò&Y²), bu•uò.Üÿ«, ı . 1.1 Monte Carlo Methods for Estimation bX1, · · · , XnèloNX•ƒëÅ, ÎÍθO˛Pè θˆ = θˆ(X1, · · · , Xn) Previous Next First Last Back Forward 1
记x=(z1,·,xn)T∈R”,以及x),x②),,为从总体X中抽取的一列独 立的随机样本观测值则有关于的性质,可以通过估计值序列(),·,x),方= 1,2,··来研究 1.1.1 Monte Carlo Estimation and Standard Error 例1:假设X1,X2i.i.d~N(0,1),估计EX1-X2 显然,0=EX1一X2的Monte Carlo估计可用通过从标准正态分布 中产生m个样本x)=(c9),x),方=1…,m.然后计算)= z》-x91,j=1,…,m.以及0的估计 m j=1 j=1 在R中很容易实现: m<-1000 Previous Next First Last Back Forward 2
Px = (x1, · · · , xn) T ∈ Rn, ±9 x (1), x(2) , · · · èloNX•ƒò’ ·ëÅ*ˇä. K k'uθˆ5ü, 屜LOäSθˆ(x (j) 1 , · · · , x (j) n ), j = 1, 2, · · · 5Ôƒ. 1.1.1 Monte Carlo Estimation and Standard Error ~ 1: bX1, X2 i.i.d ∼ N(0, 1), OE|X1 − X2|. w,, θ = E|X1 − X2|Monte CarloOå^œLlIO©Ÿ • )má x (j) = (x (j) 1 , x (j) 2 ), j = 1, · · · , m. ,Oé θˆ(j) = |x (j) 1 − x (j) 2 |, j = 1, · · · , m. ±9θO θˆ = 1 m Xm j=1 θˆ(j) = 1 m Xm j=1 |x (j) 1 − x (j) 2 |. 3R•ÈN¥¢y: ↑Code m <- 1000 Previous Next First Last Back Forward 2
g <-numeric(m) for (i in 1:m){ x <-rnorm(2) g[i]<-abs(x[1]-x[2]) est <-mean(g) est Code 我们也可以计算出EX1-X2l=2/V示三1.128379以及方差Var(X1- X2)=2-4/m.因此E8=2/V元,Var(=2-4//m. 对标准差的Monte Carlo估计我们可以从一般场合出发讨论.由于样本 量为n的样本均值又的标准差为vWar(X)/m,当X的分布未知时,可以使 用”Pug-in”法估计:由 n var(x)=(4-. n i=1 Previous Next First Last Back Forward 3
g <- numeric(m) for (i in 1:m) { x <- rnorm(2) g[i] <- abs(x[1] - x[2]) } est <- mean(g) est ↓Code ·Çèå±Oé—E|X1 − X2| = 2/ √ π .= 1.128379 ±9êV ar(|X1 − X2|) = 2 − 4/π. œdEθˆ = 2/ √ π, V ar(θˆ) = [2 − 4/π]/m. ÈIOMonte Carlo O·Çå±lòÑ|‹—u?ÿ. du ˛èn˛äX¯ IOè p V ar(X)/m, X©Ÿôû, å±¶ ^”Plug-in”{O: d V ar ˆ (X) = 1 m Xm i=1 (xi − x¯) 2 . Previous Next First Last Back Forward 3