\documentclass[11pt]{article} \usepackage{../Math545} \usepackage{amsmath,amssymb} \usepackage{enumerate} \pagestyle{plain} \renewcommand{\labelenumi}{\arabic{enumi}.} \renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}} \renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}} \setlength{\topmargin}{-0.75 in} \setlength{\textheight}{9.5 in} \parindent0in \begin{document} <>= library(knitr) # global chunk options opts_chunk$set(cache=TRUE, autodep=TRUE) options(scipen=999) options(repos=c(CRAN="https://cloud.r-project.org/")) @ \begin{center} \textsclarge{Analysis Checklist} \end{center} When faced with an analysis of a real data set, the following steps should be followed: \begin{enumerate}[1.] \item \textbf{Initial graphical checks:} Assess \begin{enumerate}[(i)] \item \textit{mean and variance stationarity}: identify any systematic changes in mean and or variance; \item \textit{correlation patterns}: examine evidence of strong positive or negative dependence; \item \textit{periodic or seasonal components}: identify any evident seasonalities (eg annual, quarterly, monthly cycles) that influence the mean level in a deterministic fashion; \item \textit{autocorrelation}: plot the acf and examine for indications of non-stationarity (ie a slowly decaying acf). \end{enumerate} \item \textbf{Pre-processing:} use pre-processing tools to attempt to form the decomposition \[ X_t = m_t + s_t + Y_t \qquad t=1,2,\ldots,n \] where $m_t$ is the deterministic mean at time $t$, $s_t$ is the deterministic seasonal component, and $Y_t$ is the stationary component of the variation. This may require \begin{enumerate}[(i)] \item log or other transformations of the data; \item smoothing to obtain $m_t$; \item parametric or non-parametric modelling of $s_t$. \end{enumerate} The \texttt{R} functions \texttt{decompose} \texttt{stl}, \texttt{HoltWinters} can be used. \medskip \textbf{Note:} Pre-processing needs to be carried out with care if forecasting is a goal, as non-parametric procedures may not be suitable for forecasting out of sample (ie for future values). \item \textbf{Differencing:} If there is no evident mean variation, but the acf decays slowly, then there may be \textit{stochastic} non-stationarity, that is, a random walk like structure in the data. This can be removed by \textit{differencing}, that is for observed series $\{x_t\}$ we might difference $d=1,2,3,\ldots$ times \[ y_t = (1-B)^d x_t \] to try to obtain stationarity. In addition, there may be \textit{stochastic seasonality} with season $s$, so \textit{ seasonal differencing} of order $D=1,2,3,\ldots$ at lag $s$ \[ y_t = (1-B^s)^D x_t \] might be used. \item \textbf{Model fitting and selection:} Having processed observed series $\{x_t\}$ into possibly stationary process $\{y_t\}$, we may then \begin{enumerate}[(i)] \item fit $\ARMA(p,q)$ models for a range of values of $p$ and $q$ using \texttt{arima}; \item select the preferred model using AIC or BIC; \item summarize the preferred model in terms of parameter estimates, fitted acf and possibly fitted values or forecasts. \end{enumerate} \item \textbf{Residual checks:} Having selected an $\ARMA(p,q)$ model, obtain the residuals from the fit, and plot them and their acf. The ideally, the residuals should resemble a white noise process, that is, \begin{enumerate}[(i)] \item have zero mean and constant variance: this can be checked in a plot. \item be uncorrelated; this can be checked by computing the residual acf. \end{enumerate} \end{enumerate} \textbf{Note:} In a real data analysis, different valid approaches may lead to different models being selected, but no model might fit the data perfectly well. <>= @ \end{document}