R로 배우는 시계열 예측
Rob J. Hyndman
Professor of Statistics at Monash University
set.seed(3) # Reproducibility
wn <- ts(rnorm(36)) # White noise
autoplot(wn) # Plot!

"백색잡음"은 iid 자료의 시계열입니다
ggAcf(wn) +
ggtitle("Sample ACF for white noise")

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

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

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

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

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

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

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

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로 배우는 시계열 예측