算法手册/ 计量经济研究/ ECM模型

ECM模型

计算公式

符号

符号含义
yt、xt原始水平值序列,不做预先差分
α、β长期均衡方程的截距与斜率
et协整回归残差,表示对长期均衡的偏离
Δ一阶差分,Δyt = yt − yt−1
λ误差修正系数;λ < 0 才有反向修正
γ0、γ1短期方程的截距与 Δx 系数
ut短期方程的残差
n模型 2 的有效样本量

核心公式

公式 (1.1):长期协整回归
\[ y_t=\alpha+\beta x_t+e_t \]
公式 (1.2):误差修正模型
\[ \Delta y_t=\gamma_0+\gamma_1\Delta x_t+\lambda e_{t-1}+u_t,\qquad \lambda\lt0 \]
公式 (1.3):误差修正项
\[ \hat e_t=y_t-\hat\alpha-\hat\beta x_t \]
公式 (1.4):残差诊断
\[ \mathrm{DW}=\frac{\sum_{t=2}^{n}\left(\hat u_t-\hat u_{t-1}\right)^2}{\sum_{t=1}^{n}\hat u_t^2},\qquad \mathrm{RMSE}=\sqrt{\frac{1}{n}\sum_{t=1}^{n}\hat u_t^2} \]

参考文献

  1. Engle, R. F., & Granger, C. W. J. (1987). Co-integration and error correction: Representation, estimation, and testing. Econometrica, 55(2), 251–276.
  2. Davidson, J. E. H., Hendry, D. F., Srba, F., & Yeo, S. (1978). Econometric modelling of the aggregate time-series relationship between consumers' expenditure and income in the United Kingdom. Economic Journal, 88(352), 661–692.
  3. Banerjee, A., Dolado, J. J., Galbraith, J. W., & Hendry, D. F. (1993). Co-integration, Error Correction, and the Econometric Analysis of Non-Stationary Data. Oxford University Press.

算法参数

本方法没有需要额外选择的算法参数:变量的选择属于分析设置,全部计算按上式的定义直接完成。

验证报告

数据与 R 包

数据文件 ecm.csv
样本与变量 N = 120;Time 1–120,Y 与 X 同阶单整且存在协整关系
R 包 stats 4.6.2(R 基础包)

提示词

以 Y 为被解释变量、X 为解释变量,喂原始水平值,按 Time 排序,做 EG 两步法 ECM。

R 代码

d <- read.csv("ecm.csv")
y <- d$Y
x <- d$X
n <- length(y)
m1 <- lm(y ~ x)
e <- resid(m1)
dy <- diff(y)
dx <- diff(x)
idx <- 2:length(dy)
m2 <- lm(dy[idx] ~ dx[idx] + e[idx])
f <- function(x) format(x, digits = 15)
print(summary(m1)$coefficients, digits = 15)
print(summary(m2)$coefficients, digits = 15)
dw <- function(m) sum(diff(resid(m))^2) / sum(resid(m)^2)
cat("R2", f(summary(m1)$r.squared), f(summary(m2)$r.squared), "\n")
cat("F", f(summary(m2)$fstatistic[1]), "DW", f(dw(m2)), "\n")
cat("AIC", f(AIC(m2)), "BIC", f(BIC(m2)), "\n")
cat("RMSE", f(sqrt(sum(resid(m2)^2) / length(idx))), "\n")

对比结果

指标SPSSAUR差值
ECM 有效样本1181180
长期 X 系数1.16462175391.16462175393.7e−11
长期常数项6.19599086386.19599086382.71e−11
长期模型 R²0.92188619230.92188619231.08e−12
ECM ΔX 系数1.24029359421.24029359421.36e−11
ECM(−1) 系数−0.2954242845−0.29542428452.77e−11
ECM 常数项0.01587310540.01587310542.61e−11
ECM 模型 R²0.62855867280.62855867284.81e−11
ECM F 值97.302375993097.30237599309.09e−12
ECM Durbin-Watson2.13162137742.13162137741.62e−11
ECM RMSE1.03124825311.03124825317.71e−12
ECM AIC348.1312055077350.13120550772
ECM BIC356.4432593811361.21394400554.77

结论:协整回归与 ECM 的系数、标准误、R²、F、DW、RMSE 均与 R 一致到 10 位小数。AIC/BIC 不同:R 的 AIC、BIC 把残差方差也算一个参数,SPSSAU 只数回归系数,所以 AIC 差 2、BIC 差 ln(118) = 4.7707,不是数值误差。ECM 样本从第 3 期起(SPSSAU 照 SPSSAU 口径),R 从第 3 期样本复现同一对齐;标准 EG 两步法会用第 2 期起,样本多 1 期。

操作手册 问题反馈

引用SPSSAU. ECM模型:计算公式与参数[EB/OL]. SPSSAU算法手册, 2026-11-20. https://www.spssau.com/algorithm/econometrics/ecm.html.