AirPassengers package:datasets R Documentation _M_o_n_t_h_l_y _A_i_r_l_i_n_e _P_a_s_s_e_n_g_e_r _N_u_m_b_e_r_s _1_9_4_9-_1_9_6_0 _D_e_s_c_r_i_p_t_i_o_n: The classic Box & Jenkins airline data. Monthly totals of international airline passengers, 1949 to 1960. _U_s_a_g_e: AirPassengers _F_o_r_m_a_t: A monthly time series, in thousands. _S_o_u_r_c_e: Box, G. E. P., Jenkins, G. M. and Reinsel, G. C. (1976) _Time Series Analysis, Forecasting and Control._ Third Edition. Holden-Day. Series G. _E_x_a_m_p_l_e_s: ## Not run: ## These are quite slow and so not run by example(AirPassengers) ## The classic 'airline model', by full ML (fit <- arima(log10(AirPassengers), c(0, 1, 1), seasonal = list(order=c(0, 1 ,1), period=12))) update(fit, method = "CSS") update(fit, x=window(log10(AirPassengers), start = 1954)) pred <- predict(fit, n.ahead = 24) tl <- pred$pred - 1.96 * pred$se tu <- pred$pred + 1.96 * pred$se ts.plot(AirPassengers, 10^tl, 10^tu, log = "y", lty = c(1,2,2)) ## full ML fit is the same if the series is reversed, CSS fit is not ap0 <- rev(log10(AirPassengers)) attributes(ap0) <- attributes(AirPassengers) arima(ap0, c(0, 1, 1), seasonal = list(order=c(0, 1 ,1), period=12)) arima(ap0, c(0, 1, 1), seasonal = list(order=c(0, 1 ,1), period=12), method = "CSS") ## Structural Time Series ap <- log10(AirPassengers) - 2 (fit <- StructTS(ap, type= "BSM")) par(mfrow=c(1,2)) plot(cbind(ap, fitted(fit)), plot.type = "single") plot(cbind(ap, tsSmooth(fit)), plot.type = "single") ## End(Not run)