本文编写于 1444 天前,最后修改于 1374 天前,其中某些信息可能已经过时。

记得刷新页面,否则公式无法正确显示

计量经济学期中复习

题目范围

James H. Stock 、 Mark W. Watson 计量经济学第四版

范围是书前4章

计算:你将需要找出事件的概率,随机变量的平均值,方差和标准差,双边检验的p值和t统计量,以及样本标准差。

开放性问题:最小二乘法

第一章 数据与数据类型

数据

有两种数据,一种是实验数据,另一种是观测数据,实验数据

Sources of data: experiment and observation

实验数据来自旨在评估治疗或政策或调查因果关系的实验。如政府对人口的普查等,代价高昂

Experimental data come from experiments designed to evaluate a treatment or policy or to investigate a causal effect.

观测数据则来自于通过观察实验环境外的实际行为获得的数据,如问卷调查,历史信贷记录等,代价比较小

Observational data – data obtained by observing actual behaviour outside an experimental setting.

类型

数据分为

(1) 时间序列数据time series

(2) 横截面数据 cross-sectional

(3) 合并数据(时间序列数据与横截面数据的联合panel

横截面数据是指某一时间内对不同对象进行调查所得来的数据,如人口普查数据。

Cross-sectional data consist of entities (workers, consumers, firms, governments and so on) observed at a single time period.

特点:时间段相同,对象不同

时间序列数据是指对同一对象在不同时间连续观察所取得的数据,如改革开放以来的GDP的数值。

Time series data consist of a single entity observed at multiple time periods.

特点:不同时间段、对象相同

在合并数据中有一类特殊的数据,称为panel数据(panel data),又称纵向数据(longitudinal or micropanel data)。

面板数据是指对同一组对象在不同时间中道连续跟踪观察所得来的数据。

即同一个横截面单位,比如说,一个家庭或一个公司,在不同时期的调查数据。例如,美国商业局在一定时期间隔内对住房的调查。在每一时期的调查中,同样的(或居住在同一地区的)家庭被调查,以观察自上一次调查以来,其住房和经济状况是否有变化。纵向数据就是通过重复上述过程而得到的,它可对研究家庭行为的动态化提供非常有用的信息。

特点:不同对象、不同时间的集合数据,纵向数据比横断数据多了一个时间维。

Panel data (longitudinal data) consist of multiple entities, where each entity is observed at two or more time periods.

比如说这个图,如果是横截面数据,那么应该只有某一年的数据,如果是时间序列数据,那么只有某一个州,但如果是Panel Data,那么应该又有时间又有每个州

第二章 概率

随机变量和概率分布

随机过程的相互排斥的潜在结果称为结果。

•The mutually exclusive potential results of a random process are called the outcomes.

结果的概率是结果长期发生的时间比例。

•The probability of an outcome is the proportion of the time that the outcome occurs in the long run.

所有可能的结果集称为示例空间。

•The set of all possible outcomes is called the sample space.

事件是一组一个或多个结果。

•An event is a set of one or more outcomes.

以上纯机翻,貌似没啥意义

变量分类

离散变量Discrete random variable :0123这类

连续型变量Continuous random variable :连续的值

两种概率分布类型

离散随机变量的概率分布是变量所有可能值的列表以及每个值发生的概率。

The probability distribution of a discrete random variable is the list of all possible values of the variable and the probability that each value will occur.

而离散变量的累积概率分布是随机变量小于或等于特定值的概率。 累积概率分布也称为累积分布函数,或 c.d.f、或者表示为Φ

The cumulative probability distribution for a discrete variable is the probability that the random variable is less than or equal to particular value.

A cumulative probability distribution is also referred to as a cumulative distribution function, or c.d.f

一图胜千言

概率分布的分支:伯努利分布

说白了就是二项分布,非黑即白,非正即负

•A binary random variable is called a Bernoulli random variable and its probability distribution is called the Bernoulli distribution.


连续随机变量的累积概率分布是随机变量小于或等于特定值的概率。

The cumulative probability distribution of a continuous random variable is the probability that the random variable is less than or equal to a particular value.

连续随机变量的概率密度函数 (p.d.f.) 是一个函数,可以集成以获得随机变量在给定间隔内获取值的概率。

The probability density function (p.d.f.) of a continuous random variable** is a function which can be integrated to obtain the probability that the random variable takes a value in a given interval.

总结下,

PDF,是概率密度函数,描述可能性的变化情况,如正态分布密度函数,在中间出现的情况最大,两端出现的情况较小。

CDF,是分布函数,描述发生某事件概率。任何一个CDF,是一个不减函数,最终等于1。上面的pdf描述了CDF的变化趋势,即曲线的斜率。

重要参数

  1. 平均数

平均数Mean,又称期望值E(Y),µ(y)

The expected value (mean) of a random variable Y, denoted E(Y), is the long-run average value of the random variable over many repeated trials or occurrences.

离散随机变量的平均值计算为该随机变量的可能结果的加权平均值,其中权重是该结果的概率。

The mean of a discrete random variable is computed as a weighted average of the possible outcomes of that random variable, where the weights are the probabilities of that outcome.

这个小学就学过,都懂

计算平均值

期望值或平均数:\\ E(Y)= y_1p_1 + y_2p_2+…y_kp_k=\sum y_ip_i, \\ \bar y 是个值, p\ 是概率\\ 伯努利分布的期望\\ E(G)= 1 * p + 0 * (1-p) = p

计算平均值概率分布

连续随机变量的预期值:

•Pr (a≤Y ≤b)= ∫ fY(y) dy

•E(Y)= μY= ∫ yfY(y) dy

  1. 方差

方差variance和标准差standard deviation 测量概率分布的分散或"点差"。

方差写作 Var(Y) 或σ^2_y 或者D(Y)

\begin{aligned} &伯努利随机变量\\ var (Y)&=\sigma^2_Y \\ &= E[(Y-μ_Y)^2] \\ &= E(Y^2) – (μ_Y)^2 \\ &=\sum(y_i-μ_Y)^2p_i\\ \\ &对于连续变量\\ var (G) &= \sigma^2_G \\ &= (0-p)^2* (1-p) + (1-p)^2 * p \\ &= p (1-p)\\ \\ var (Y) &= E(Y-μ_Y)^2 \\ &= ∫ (y-μY)^2fY(y) dy\\ \\ &对于线性函数:Y= a+ bx\\ E(Y)&= μ_Y\\ &= a + bμ_x\\ σ^2_Y&= b^2 σ^2_X \end{aligned}

这里的最后一条展示了方差的变化,一直总体求样本方差

  1. 偏斜度skewness

偏斜度衡量分布缺乏对称性。

The skewness measures the lack of symmetry of a distribution.

随机变量 Y 分布的偏斜性是: 倾斜度 E[(Y-Y)3] / 3Y

The skewness of the distribution of a random variable Y is:

Skewness= E[(Y-μY)3] / σ3Y

如果是对称则为0,右边偏为正,左边偏斜为负

  1. 峰度Kurtosis

峰度测量分布的尾部有多厚或有多重。

•The kurtosis measures how thick, or heavy, are the tails of a distribution.

峰度是 Y 的方差量来自极值的度量。

•The kurtosis is a measure of how much of the variance of Y arises from extreme values.

Y 的极端值称为异常值。

•An extreme value of Y is called an outlier.

分布的峰度越大,异常值的可能性就越大。

•The greater the kurtosis of a distribution, the more likely are outliers.

峰度 - E [(Y-Y)4] / .4Y

Kurtosis = E [(Y-μY)4] / σ4Y

计量方法

中间值是3,也是正态分布的图峰度,超过3就越陡峭,小于3就越平滑

•The kurtosis of a normally distributed variable is 3 (mesokurtic).

•A distribution with a kurtosis exceeding 3 is called leptokurtic, or heavy-tailed.

•A distribution with a kurtosis less than 3 is called platykurtic, or light-tailed.

  1. 分布矩MOMENTS OF DISTRIBUTION

说实话,看不懂

概率分布的计算

参考

联合概率分布joint probability distribution

两个离散随机变量(X 和 Y)的联合概率分布是随机变量同时获取特定值(x 和 y)的概率。

边际概率分布marginal probability distribution

Y 的边际概率分布(概率分布的另一个名称)是通过将 Y 具有指定值的所有可能结果的概率相加来计算的 X 和 Y 的联合分布。

我们知道了一组变量的联合概率分布,但想要了解其中一个子集的概率分布。这种定义在子集上的概率分布被称为 边缘概率分布(marginal probability distribution)。可以用求和法则算

Pr (Y=y) = \sum_{i=1}^{l} Pr (X=x_i, Y=y)

比如说,联合概率分布中下雨,又长交流的概率Pr(x=0,y=0)=0.15,边际概率分布长交流(可能下雨可能不下雨)就是0.15+0.07=0.22

条件概率分布Conditional Distribution

贝叶斯分布

Pr (Y=y│X=x) = \frac{Pr (X=x, Y=y)}{ Pr (X=x)}

在x发生的情况下Y发生的概率

条件期望

E(Y)= \sum_{i=1}^{i} E(Y│X=x_i) Pr (X=x_i)

条件方差

Conditional variance: var (Y │X=x) =∑ [ yi – E(Y │X=x)]2 Pr (Y=yi│X=xi)

独立的事件

如果知道其中一个变量的值不提供有关另一个变量的信息,则两个随机变量 X 和 Y 是独立分布的,或者是独立的。

•Two random variables X and Y are independently distributed, or independent, if knowing the value of one of the variables provides no information about the other.

独立分布满足:

•Pr (Y=y│X=x) = Pr (Y=y)

•Pr (X=x, Y=y) = Pr (X=x) Pr (Y=y)

协方差Covariance

两个随机变量一起移动的程度的一个度量是它们的协方差。

\begin{aligned} cov (X,Y) &= σ_{XY} \\ &= E[(X-μ_x)(Y-μ_Y] \\ &= \sum_{i=1}^{k}\sum_{j=1}^{l}(x_j- μ_x)(y_i- μ_Y) Pr (X=x_j, Y= y_i) \end{aligned}

如果 X 和 Y 向同一方向移动,则协方差将为正。

如果 X 和 Y 向相反方向移动,则协方差将为负数。

如果 X 和 Y 是独立的,则协方差将为零

性质

cov (X,Y) = E (XY)- E(X)E(Y)

cov (X,X) = σXX= σ2X

cov (X, a) = 0

cov (aX, bY) = ab cov (X,Y)

相关性Corelation

X 和 Y 之间的相关性是 X 和 Y 之间的协方差除以其标准差:

\begin{aligned} corr (X,Y) &= \frac{cov (X,Y)} {\sqrt{ (var (X) var (Y)}} \\ &= \frac{σ_{XY}}{σ_Xσ_Y} \end{aligned}

相关性始终介于 -1 和 1 之间。

越靠近+1正相关性越大,反之越靠近-1负相关性越大

如果 corr (X,Y) 等于 0,则变量 X 和 Y 表示不相关。

计算法则

•E (X+Y) = E(X) + E (Y) = μx + μY

•var (X+Y) = var (X) + var (Y) + 2 cov (X,Y) = σ2X + σ2Y + 2σXY

•If X and Y are independent, then var (X+Y) = var (X) + var (Y) = σ2X + σ2Y

•E (a+bX+cY)= a+ bμx + cμY

•var (a+bY) = b2 σ2Y

•var (aX+bY) = a2 σ2X +2ab σXY+ b2 σ2Y

•E(Y2)= σ2Y+ μ2Y

•cov (a+bX+cV, Y) = bσXY+c σVY

•E(XY) = σXY+ μxμY

•σ2XY≤ σ2X σ2Y

正态分布

•正态分布Normal distribution (for a continuous random variable)

表示为N(μ, σ2) : 平均数,方差,

具有标准正态分布的随机变量表示 Z标准正态累积分布函数由Φ表示,因此 Pr(Z<c) = Φ(c)

标准正态分布是正态分布,为 μ=0 和 σ2=1,表示为N(0,1)

正态分布标准化

如果 Y 是分布 N (μ,σ2), 则Z = (Y- μ) / σ

If Y is distributed N (μ, σ2) ,then Z = (Y- μ) / σ

正态分布求概率

c1 and c2 are two numbers , c1< c2

d1 = (c1- μ) / σ ; d2= (c2- μ) / σ

Pr (Y≤c2) = Pr (Z≤ d2) = Φ (d2)

Pr (Y≥c1) = Pr (Z≥ d1) =1- Φ (d1)

Pr (c1 ≤Y≤c2) = Pr (d1 ≤ Z ≤ d2) =Ф (d2) - Φ (d1)

查正态分布的表就行

样本和总体抽样

从总体中取样本,有总体的值,求样本值

https://www.cnblogs.com/zzdbullet/p/10087196.html

\begin{aligned} &有了总体的各种数据,求样本平均数\\ \bar Y &= \frac{1}{n} (Y_1+Y_2 …. Y_n) \\ &= \frac{1}{n} \sum_{i=1}^{n} Y_i \\\\ &求样本期望\\ E(\bar Y)&= \frac{1}{n}\sum_{i=1}^{n}E(Y_i) \\ &= μ_Y\\\\ &求样本方差\\ var (\bar Y) &= \frac{σ^2_Y}{n}\\&这个地方又说是分母是n-1,可以修正误差\\\\ &求样本正态分布\\ \bar Y &\sim N (μ_Y, \frac{σ^2_Y}{n}) \end{aligned}

大数定理与中心极限法则

近似方法的两种工具:大数定律和中心极限定理

大数定律表示,当样本大小 (n) 较大时,Y 将接近 μY。

条件:Yi 是 i.i.d独立同分布,方差有限

The law of large numbers says that ̅Y will be close to μY when the sample size (n) is large. Conditions: Yi are i.i.d and the variance is finite

中心极限定理表示,当样本尺寸较大时,标准化样本平均值(̅Y –μY) /σ ̅Y 的采样分布大致为正态分布: ̅Y~ N(0,1)

The central limit theorem says that the sampling distribution of the standardized sample average (̅Y –μY) /σ ̅Y is approximately normal when the sample size is large: ̅Y~ N(0,1)

第三章 假设检验

请看前一篇博文

第四章 一元线性回归

不要太简单,初中知识而已

A\ population\ regression\ function:\\ Y_i = β_0 + β_1X_i + u_i \\ β_0 - the\ intercept \\ β_1 – the\ slope \\ Y – the\ dependent variable\\ X – the\ independent variable (regressor) \\ u_i – the\ error term \\

beta0和beta1不知道,就要用最小二乘法算ordinary least squares (OLS) estimators

最小二乘法ordinary least squares (OLS)

在 ∑ (Yi – b0 – b1Xi)^2 中最小化平方错误总和的截距和斜率的估计值就是最小二乘法estimator

The estimators of the intercept and slope that minimize the sum of squared mistakes in ∑ (Yi – b0 – b1Xi)2

β0的 OLS 估计值值值表示 β0^, β1 的 OLS 估计值器表示β1^

The OLS estimator of β0 is denoted β0^, and the OLS estimator of β1 is denoted β1^.

计算

截距\hat β_0 = \bar Y - \hat β_1 \bar X\\斜率\hat β_1 = \frac{\sum_{i=1}^{n} (X_i-\bar X)(Y_i -\bar Y)}{ \sum_{i=1}^{n} (X_i -\bar X)^2}= \frac{s_{XY}}{s^2_X}

OLS 回归线也称为样本回归线或样本回归函数。

The OLS regression line is also called the sample regression line or sample regression function.

̅Y = β0^ + β1^X

基于OLS回归线给出的Yi给出的预测值是Yi^

The predicted value of Yi given, based on the OLS regression line, is Yi^.

第 i 次观测的残差是Yi及其预测值之间的差值

The residual for the ith observation is the difference between Yi and its predicted value: ui^= Yi – Yi^

名词解释

R^2表示多少的数据能用计算得到的线性回归表示

R2是Yi^样品方差与Yi样本方差的样本偏差比。

R2 可以写成解释的平方总和与平方总和的比率。

解释的平方总和 (ESS)是Yi, Yi^, 预测值与其平均值的平方偏差之和。

平方 (TSS) 的总和是 Yi 与其平均值的平方偏差之和。

总之

R^2 = ESS/TSS=1-SSR/TSS

TSS总计-ESS回归=SSR残差

SSR = ∑ui^2

ESS explained sum of squares 因变量的方差和(回归平方和)

TSS total sum of squares 总集样本的方差和(样本平方和)

SSR sum of squared residuals 残差的平方和

这些在线性回归中都会有显示

SERstandard error of the regression 回归的标准误差

SER = su^,where su^2= (1/ (n-2)) ∑(ui^2) = SSR/ (n-2)

最小二乘法的假设

https://www.cnblogs.com/HuZihu/p/10142737.html

  • 自变量(X)和因变量(y)线性相关
  • 自变量(X)之间相互独立
  • 误差项(ε)之间相互独立
  • 误差项(ε)呈正态分布,期望为0,方差为定值
  • 自变量(X)和误差项(ε)之间相互独立

Assumption 1: the conditional distribution of ui given Xi has a mean of zero – E(ui│Xi) = 0

Assumption 2: (Xi, Yi), i= 1,…,n, are independently and identically distributed (i.i.d.)

Assumption 3: large outliers are unlikely