# 计量经济学期中复习

## 题目范围

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

## 第一章 数据与数据类型

### 数据

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.

特点：时间段相同，对象不同

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

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

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

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

## 第二章 概率

### 随机变量和概率分布

•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.

#### 两种概率分布类型

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.

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.

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.

#### 计算平均值概率分布

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

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

1. 方差

方差写作 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.

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.

•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.

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

### 概率分布的计算

#### 边际概率分布marginal probability distribution

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

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

#### 条件概率分布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)

### 独立的事件

•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}

#### 性质

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负相关性越大

如果 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)

#### 正态分布标准化

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}

### 大数定理与中心极限法则

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

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)

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^.

#### 计算

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

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

̅Y = β0^ + β1^X

The predicted value of Yi given, based on the OLS regression line, is 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^, 预测值与其平均值的平方偏差之和。

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