白噪声

R 中的预测

Rob J. Hyndman

Professor of Statistics at Monash University

白噪声

set.seed(3)          # Reproducibility
wn <- ts(rnorm(36))  # White noise
autoplot(wn)         # Plot!

白噪声序列示例

"白噪声"即独立同分布(iid)的时间序列

R 中的预测

白噪声的 ACF

ggAcf(wn) +
    ggtitle("Sample ACF for white noise")

白噪声的样本 ACF

R 中的预测

白噪声的 ACF

ggAcf(wn) +
    ggtitle("Sample ACF for white noise")

白噪声的样本 ACF

R 中的预测

白噪声的 ACF

ggAcf(wn) +
    ggtitle("Sample ACF for white noise")

白噪声的样本 ACF

R 中的预测

白噪声的 ACF

ggAcf(wn) +
    ggtitle("Sample ACF for white noise")

白噪声的样本 ACF

R 中的预测

示例:生猪屠宰量

pigs <- window(pigs, start=1990)
autoplot(pigs/1000) +
  xlab("Year") +
  ylab("thousands") +
  ggtitle("Monthly number of pigs slaughtered in Victoria")

维多利亚州每月生猪屠宰量(千头)

R 中的预测

示例:生猪屠宰量

ggAcf(pigs) +
  ggtitle("ACF of monthly pigs slaughtered
          in Victoria")

维多利亚州每月生猪屠宰量的自相关函数(ACF)

R 中的预测

示例:生猪屠宰量

ggAcf(pigs) +
  ggtitle("ACF of monthly pigs slaughtered
          in Victoria")

维多利亚州每月生猪屠宰量的自相关函数(ACF)

R 中的预测

示例:生猪屠宰量

ggAcf(pigs) +
  ggtitle("ACF of monthly pigs slaughtered
          in Victoria")

维多利亚州每月生猪屠宰量的自相关函数(ACF)

R 中的预测

Ljung-Box 检验

Ljung-Box 检验将前 h 个自相关值合并一起考察。

显著(p 值很小)表示数据很可能不是白噪声。

Box.test(pigs, lag = 24, fitdf = 0, type = "Lj")
Box-Ljung test
data:  pigs
X-squared = 634.15, df = 24, p-value < 2.2e-16
R 中的预测

白噪声小结

  • 白噪声:纯随机的时间序列
  • 可通过 ACF 图或 Ljung-Box 检验进行判断
R 中的预测

让我们练习!

R 中的预测

Preparing Video For Download...