关于统计学(1)

最近学了几门统计学课程,做简单整理和粗浅理解

1.统计学的分类
A.描述。它所做的是收集数据,汇总数据,然后做presentation。这部分不属于数学的范畴,更多的属于美学或者关于表现力的科学。
B.推断。预测是我们关注的。具体而言,由样本=》整体,由已知=》未知的过程。由于现有数据永远不等同于全部数据,我们无法得到关于事件的全部信息,所以预测、推断总是具有不确定性,那么就与概率有了千丝万缕的关系。我们关注的是B。
2.关于概率论和统计之间的关系
先看一幅图:
 
这幅图很好的表现了概率和统计的关系:
概率是一种演绎推理,从整体到部分的过程。
统计是一种归纳推理,从部分到整体的过程。
3.一个类比
我贴出英文:

Probability is straightforward: you have the bear. Measure the foot size, the leg length, and you can deduce the footprints. “Oh, Mr. Bubbles weighs 400lbs and has 3-foot legs, and will make tracks like this.” More academically: “We have a fair coin. After 10 flips, here are the possible outcomes.”

Statistics is harder. We measure the footprints and have to guess what animal it could be. A bear? A human? If we get 6 heads and 4 tails, what’re the chances of a fair coin?

The Usual Suspects

Here’s how we “find the animal” with statistics:

Get the tracks. Each piece of data is a point in “connect the dots”. The more data, the clearer the shape (1 spot in connect-the-dots isn’t helpful. One data point makes it hard to find a trend.)

Measure the basic characteristics. Every footprint has a depth, width, and height. Every data set has a mean, median, standard deviation, and so on. These universal, generic descriptions give a rough narrowing: “The footprint is 6 inches wide: a small bear, or a large man?”

Find the species. There are dozens of possible animals (probability distributions) to consider. We narrow it down with prior knowledge of the system. In the woods? Think horses, not zebras. Dealing with yes/no questions? Consider a binomial distribution.

Look up the specific animal. Once we have the distribution (“bears”), we look up our generic measurements in a table. “A 6-inch wide, 2-inch deep pawprint is most likely a 3-year-old, 400-lbs bear”. The lookup table is generated from the probability distribution, i.e. making measurements when the animal is in the zoo.

Make additional predictions. Once we know the animal, we can predict future behavior and other traits (“According to our calculations, Mr. Bubbles will poop in the woods.”). Statistics helps us get information about the origin of the data, from the data itself.

事实上,统计包括这几个关键环节:
a.采集数据:涉及几个问题:实验设计的问题,采集方法的问题,采集量怎样才最合适的问题等等
b.处理数据:类似于presentation,得出一些统计量(median,mean,var,cov,ρ,etc),并且剔除掉一些不合理的样本
前两步的核心问题是:怎样让样本更好的呈现总体
 
c.预测分布和建模:使用先验知识,从概率分布入手,给数据一个合理的“框”。比如预测身高,我们很显然的赋以高斯分布。
d.估计:使用已处理数据和预测的分布结合进行估计。
这两步的核心是:正确的数学建模
 
e.预测问题:预测不准确,要从a~d中找出问题进行模型更正。从而构成一个有反馈的循环。
 
4.继续深入
A.简单随机抽样、大数定理和中心极限定理
总体一个具有确定概率分布的随机变量。样本具有双重性:抽样前,样本是一个随机变量;抽样后,样本是一个数组。
为了使样本更好的反映总体,我们要求样本具有:随机性,独立性、代表性。随机性和代表性是为了让样本才能更好的反映总体,独立性则是为了分析的便利,有以上性质的抽样叫简单随机抽样。引入简单随机抽样,就可以利用概率论中的独立同分布随机变量的定理:例如辛钦大数定律,列维定理等。
例如,由辛钦大数定律,样本足够多时,样本的n阶矩依概率收敛于总体的n阶矩。由列维定理,样本足够多时,样本均值近似服从正态分布。
 
B.贝叶斯原理
贝叶斯公式:
from:http://www.bubuko.com/infodetail-481779.html
又名后验概率公式:后验概率=似然函数*先验概率/证据因子。(证据因子也是似然函数和先验概率的乘积之和)=观测*先验/归一化因子
解释如下,假设我们根据“手臂是否很长”这个随机变量(取值为“手臂很长”或“手臂不长”)的观测样本数据来分析远处一个生物是猩猩类别还是人类类别(假设总共只有这2种类别)。我们身处一个人迹罕至的深山老林里,且之前就有很多报道说这里有猩猩出没,所以无需观测样本数据就知道是猩猩的先验概率(Prior Probability)较大,比如根据历史数据估计有70%=0.7。接着,我们得到了的观测样本数据:“手臂很长”──而猩猩类别表现为这种特征的类条件概率,或者说这种“可能性”即似然(Likelihood)较大,相比于人类表现为“手臂很长”的似然。所以经这次观测之后加强了我们的判断:是一只猩猩的后验概率(Posterior Probability)变得比先验概率更大,超过了之前的70%!反之,如果观测发现这个生物的手臂不长,而猩猩类别表现为“手臂不长”的似然较小,则会减弱我们的判断,是猩猩的后验概率将小于70%。因此,后验概率包含了先验信息以及观测样本数据提供的后验信息,对先验概率进行了修正,更接近真实情况。此外,证据因子(Evidence,也被称为归一化常数)可仅看成一个权值因子,以保证各类别的后验概率总和为1从而满足概率条件。
似然函数是观测函数。它已经不局限于贝叶斯定理的范畴,在假设检验、估计上都有重要应用。
wikipedia:
In statistics, a likelihood function (often simply the likelihood) is a function of the parameters of a statistical model. Likelihood functions play a key role in statistical inference, especially methods of estimating a parameter from a set of statistics. In informal contexts, "likelihood" is often used as a synonym for "probability." But in statistical usage, a distinction is made depending on the roles of the outcome or parameter. Probability is used when describing a function of the outcome given a fixed parameter value. For example, if a coin is flipped 10 times and it is a fair coin, what is the probability of it landing heads-up every time? Likelihood is used when describing a function of a parameter given an outcome. For example, if a coin is flipped 10 times and it has landed heads-up 10 times, what is the likelihood that the coin is fair?
 
贝叶斯原理的应用已经发展为贝叶斯学派。他们主张要利用先验知识去修正结果。如果说非贝叶斯学派主要利用总体和样本间的关系(大数定律、列维定理,etc),那么贝叶斯学派在此基础上加上了贝叶斯定理,认为一切都是事件发生都是在某种条件下的发生,观测并不可信。我们将看到它的应用。
 
C.假设检验
引用wikipedia:
statistical hypothesis test is a method of statistical inference. Commonly, two statistical data sets are compared, or a data set obtained by sampling is compared against a synthetic data set from an idealized model. A hypothesis is proposed for the statistical relationship between the two data sets, and this is compared as an alternative to an idealized null hypothesis that proposes no relationship between two data sets. The comparison is deemed statistically significant if the relationship between the data sets would be an unlikely realization of the null hypothesis according to a threshold probability—the significance level. Hypothesis tests are used in determining what outcomes of a study would lead to a rejection of the null hypothesis for a pre-specified level of significance.
 
它基于小概率思想,提出一个假设,使用统计量检验,如果假设成立的可能性很小(例如0.05)就应该被拒绝。
统计量的构造必然和样本、总体都有关系。我见过的三种检测:
Chi-Sqaured test:
observed表示#观察,expected表示#期望。它可以用于相关性检测(如果两个变量不相关,observed和expected相差肯定比较大),从它的反面来说,可以用于拟合检测。
t-test:
公式我们观察到样本均值,样本标准差和总体均值。如果样本均值和总体均值的差越小,t就会越小,也就是说,t-test可以用于检验样本和总体的差别大小(差别很大是不是不相关)
F-test:
两个样本方差的比值,这里的意义就是两个组(group)了。F越大,分组的意义越小。
以上检验的总体基于高斯分布。在此处区别chi-squared test,t-test,F-test和chi-squared distribution,t-distribution,F-distribution是很必要的。
假设检验既属于预测,也属于估计的问题。
 
还有一种检验叫做似然比检验。它是利用似然比函数的对数(-2ln(LR))极限分布是chi-squared这一事实进行的一种对参数的检验。
posted @ 2015-12-01 15:26  霖霖柒  阅读(403)  评论(0)    收藏  举报