R 中的时间序列分析
David S. Matteson
Associate Professor at Cornell University
白噪声(WN)是最简单的平稳过程示例。
弱白噪声过程具有:
白噪声的时间序列图:

白噪声的时间序列图?

# 从 WN 模型模拟 n = 50 个观测
WN_1 <- arima.sim(model = list(order = c(0, 0, 0)), n = 50)
head(WN_1)
-0.005052984 0.042669765 3.261154066
2.486431235 0.283119322 1.543525773
ts.plot(WN_1)

# 从均值 = 4、sd = 2 的 WN 模型模拟
WN_2 <- arima.sim(model = list(order = c(0, 0, 0)),
n = 50, mean = 4, sd = 2)
ts.plot(WN_2)

# 使用 arima() 拟合 WN 模型 arima(WN_2, order = c(0, 0, 0))Coefficients: intercept 4.0739 s.e. 0.2698 sigma^2 estimated as 3.639
# 计算 WN 的样本均值与样本方差 mean(WN_2)4.0739var(WN_2)3.713
R 中的时间序列分析