Interval Estimation 区间预估

Refer to R Tutorial andExercise Solution

It is a common requirement to efficiently estimate population parameters based on simple random sample data.

基于简单随机样本来estimate全局参数, 由于是预估, 一般是预估一个区间, 所以称为区间预估.

Point Estimate of Population Mean, 全局平均值的点估计

For any particular random sample, we can always compute its sample mean.

> library(MASS)                  # load the MASS package  
> height.survey = survey$Height

> mean(height.survey, na.rm=TRUE)  # skip missing values  
[1] 172.38

直接用样本mean来作为全局mean, 显然这个方法比较简陋

 

Interval Estimate of Population Mean with Known Variance, 已知全局方差的全局平均值的区间预估

Here, we discuss the case where the population variance σ2 is assumed known.

Let us denote the 100(1 −α∕2) percentile of the standard normal distribution as zα∕2. For random sample of sufficiently large size, the end points of the interval estimate at (1 − α) confidence level is given as follows:

这个就比直接用样本平均值高级点, 虽然我不知道为什么是这样来用全局方差

Assume the population standard deviation σ of the student height in survey is 9.48. Find the margin of error and interval estimate at 95% confidence level(1 − α).

> library(MASS)                  # load the MASS package  
> height.response = na.omit(survey$Height)

 

> n = length(height.response)  
> sigma = 9.48                   # population standard deviation  
> sem = sigma/sqrt(n); sem       # standard error of the mean  
[1] 0.65575

 

> E = qnorm(.975)∗sem; E         # margin of error  
[1] 1.2852

 

> xbar = mean(height.response)   # sample mean  
> xbar + c(−E, E)  
[1] 171.10 173.67

 

Interval Estimate of Population Mean with Unknown Variance, 未知全局方差的全局平均值的区间预估

Here, we discuss the case where the population variance is not assumed.

Let us denote the 100(1 −α∕2) percentile of the Student t distribution with n− 1 degrees of freedom as tα∕2. For random samples of sufficiently large size, and with standard deviation s, the end points of the interval estimate at (1 −α) confidence level is given as follows:

不知道全局方差, 就通过样品标准偏差(samples standard deviation)来替代全局方差进行预估, 更牛比了点

Without assuming the population standard deviation of the student height in survey, find the margin of error and interval estimate at 95% confidence level.

> n = length(height.response)  
> s = sd(height.response)        # sample standard deviation  
> SE = s/sqrt(n); SE             # standard error estimate  
[1] 0.68117

> E = qt(.975, df=n−1)∗SE; E     # margin of error  
[1] 1.3429

 

Sampling Size of Population Mean, 样本数量

The quality of a sample survey can be improved by increasing the sample size. The formula below provide the sample size needed under the requirement of population mean interval estimate at (1 −α) confidence level, margin of error E, and population variance σ2. Here, zα∕2 is the 100(1 − α∕2) percentile of the standard normal distribution.

样本越大当然预测就越准, 这个公式就是来算合适的样本size的

Assume the population standard deviation σ of the student height in survey is 9.48. Find the sample size needed to achieve a 1.2 centimeters margin of error at 95% confidence level.

 

> zstar = qnorm(.975)  
> sigma = 9.48  
> E = 1.2  
> zstar^2 ∗ sigma^2/ E^2  
[1] 239.75

 

Point Estimate of Population Proportion, 全局比例的点预估

Multiple choice questionnaires in a survey are often used to determine the the proportion of a population with certain characteristic. For example, we can estimate the proportion of female students in the university based on the result in the sample data set survey.

Find a point estimate of the female student proportion from survey.

> library(MASS)                  # load the MASS package  
> gender.response = na.omit(survey$Sex)  
> n = length(gender.response)    # valid responses count

> k = sum(gender.response == "Female")  
> pbar = k/n; pbar  
[1] 0.5

 

Interval Estimate of Population Proportion

After we found a point sample estimate of the population proportion, we would need to estimate its confidence interval.

Let us denote the 100(1 −α∕2) percentile of the standard normal distribution as zα∕2. If the samples size n and population proportion p satisfy the condition that np ≥ 5 and n(1 − p) ≥ 5, than the end points of the interval estimate at (1 − α) confidence level is defined in terms of the sample proportion as follows.

Sampling Size of Population Proportion

The quality of a sample survey can be improved by increasing the sample size. The formula below provide the sample size needed under the requirement of population proportion interval estimate at (1 − α) confidence level, margin of error E, and planned proportion estimate p. Here, zα∕2 is the 100(1 − α∕2) percentile of the standard normal distribution.

本文章摘自博客园,原文发布日期:2012-02-17

时间: 2024-08-31 17:27:27

Interval Estimation 区间预估的相关文章

阿里巴巴开盘价区间每股84-87美元,市值最高将突破2100亿美元

阿里巴巴开盘价区间每股84-87美元8月19日消息,阿里巴巴今日在纽交所正式上市.在敲钟仪式完成后的40分钟,纽交所电子公告板首次显示出了开盘价区间为每股80-8 3美元之间.随后公告板再次露出第二次调整的价格区间为每股82-85美元.截至记者发稿前,电子公告版第三次显示价格区间为每股84-87美元.若依此价格区间预估,阿里巴巴开盘后的市值将达到2070.6.3-2144.55亿美元.纽交所的一名分析师表示,具体的开盘价不一定在现 有的价格区间中产生,该区间仅体现目前买方和卖方给出即时价格的展示

网站数据分析:参数估计与置信区间

中介交易 http://www.aliyun.com/zixun/aggregation/6858.html">SEO诊断 淘宝客 云主机 技术大厅 我们总是希望能够从一些样本数据中去探究数据总体的表现特征,在网站数据分析中也是如此,我们试图从最近几天的数据表现来推测目前网站的整体形势是怎么样的,有没有变好或者变差的信号,但当前几天的数据无法完全代表总体,所以这里只能使用"估计".同时,网站的数据始终存在波动,将最近时间段的数据作为抽样样本很可能数据正好处于较低或者较高

Google Website Optimizer报告解读

  前段时间用博客的几个测试页面尝试了下使用Google Website Optimizer做A/B测试,经过这段时间收集了一些测试数据,感谢大家帮忙点击.其实之前一直想介绍Google的这个网站对比实验优化工具,完全免费而且操作简单,并且在不久的将来独立的Google Website Optimizer就会消失,这块功能会被整合到Google Analytics里面,相信很多GA的用户已经在Content模块中发现了新增的Experiments这个功能,这个就是从Google Website

敏捷软件开发实践-Sprint Story Point Estimation

介绍: 对于story来说,一个很重要的衡量它的大小的因素就是story point,它不等同于软件工作量评估中的Function Point,因为story point只是用来粗略的相对的估计story的大小,而Function Point则是用来衡量功能模块的精确大小并且要参与到公式计算的,这里澄清下. story point的估算是一门很深的学问,而且我们不能马虎,因为如果我们估算少了,那么就会导致实际我们的花费时间远高于估算时间从而导致team加班加点,如果估多了,会导致我们team很闲

业余草推荐阿里妈妈自研广告点击率预估核心算法MLR

业余草推荐阿里妈妈自研广告点击率预估核心算法MLR. 小编觉得CTR(广告点击率)预估的能力对于广告系统的意义和重要性,类似于在证券市场上预测股价的能力,优秀的CTR预测,通向美好和财富...(以下转载内容部分较为干货,文科生不易看懂是正常的,静静地欣赏数学之美即可...) 阿里妈妈国内领先的大数据营销平台,拥有阿里巴巴集团核心商业数据.在这里每天有超过50亿的推广流量完成超过3亿件商品的推广展现,覆盖高达98%的网民,实现数字媒体的一站式触达.在这些鲜亮数字背后,是什么样的核心算法在起作用?如

移动广告CPM区间从10元到500元都合理

微信上,鬼脚七写了篇很干很干的干货,分析自媒体广告价值与价格. 理工男就是理工男,很理性,逻辑很严密.文科出身如我,虽然做媒体管理近十年,广告运营三五年了,有些数字还是消化起来吃力.但还是很感谢他.只能神交. 我在潘潘同学(zhiqiran002)发起的"自媒体研习班"微信群上,转了鬼脚七的文章,并且答应,自己也分享点东西:实践及思考篇.并且借天下网商主编许维同学的(THE ONE @许维)账号分享出去.希望自己的烂水平不要降低了许维的影响力指数. 事实上,过去三年我和团队就运营着鬼脚

基于用户投票的排名算法(五):威尔逊区间

迄今为止,这个系列都在讨论,如何给出"某个时段"的排名,比如"过去24小时最热门的文章". 但是,很多场合需要的是"所有时段"的排名,比如"最受用户好评的产品". 这时,时间因素就不需要考虑了.这个系列的最后两篇,就研究不考虑时间因素的情况下,如何给出排名. 一种常见的错误算法是: 得分 = 赞成票 - 反对票 假定有两个项目,项目A是60张赞成票,40张反对票,项目B是550张赞成票,450张反对票.请问,谁应该排在前面?按

重磅!阿里妈妈首次公开自研CTR预估核心算法MLR

一. 技术背景 CTR(Click-Through-Rate)即点击通过率,是互联网广告常用的术语,指网络广告(图片广告/文字广告/关键词广告/排名广告/视频广告等)的点击到达率,即该广告的实际点击次数除以广告的展现量.点击率预估(Click-Through Rate Prediction)是互联网主流应用(广告.推荐.搜索等)的核心算法问题,包括Google.Facebook等业界巨头对这个问题一直进行着持续投入和研究. CTR预估是互联网计算广告中的关键技术环节,预估准确性直接影响公司广告收

58同城上调IPO定价区间:最多筹资2亿美元

摘要: 北京时间10月30日凌晨消息, 58同城 周二向美国证券交易委员会(SEC)提交了更新的IPO(首次公开招股)招股书.该文件显示,58同城上调了IPO定价区间. 文件称:2013年10月20日初步招股书中 北京时间10月30日凌晨消息, 58同城 周二向美国证券交易委员会(SEC)提交了更新的IPO(首次公开招股)招股书.该文件显示,58同城上调了IPO定价区间. 文件称:"2013年10月20日初步招股书中预估的IPO定价区间为每股美国存托凭证13美元到15美元,而现在已更改为每股美国