# 'Arima + fourier' for periodic data Improvement Suggestions

On the plot black is the data and red are the fitted values obtained from fitted i.e. one step forecast, I am using 365 days for training and then 3000+ days for testing, I choose value of k using cross-validation on 365 data points. Following is the model I used:

Arima(data, order=c(2,0,2),xreg=forecast::fourier(min_temp_aus,57)) How can I improve the fit on both extremes?

PS: Square loss is of 17524 considering I am predicting 3000+ data points. The way I am looking at it is, if I am off by 1 with every prediction still it makes a loss of 3000. I thought it is good, but maybe I am wrong.

Eye-balling. The fit does not look too bad. There is a clear seasonal pattern that your model seems to be picking up.

Residuals. What you should always look at are the fit and the forecast residuals: fit residuals, $e_t := y_t - \hat{y}_t$, and forecast residuals, $e_{t+1|t} := y_{t+1} - \hat{y}_{t+1|t}$. ( Where $e_{t+1|t}$ is the prediction residual of the forecast at time $t$ for time $t+1$. )

Some ways of looking at these residuals:

1. Is there a seasonal pattern in the residuals? If so, find out its period and add this into back into the model through the exogenous Fourier regressors.
2. Is there remaining auto-correlation in the residuals? Yes: add AR or MA terms, or change model along different avenues. No: you're good.
3. Look at histogram of residuals: do they look normal? Is their mean equal to zero? If yes: you're fine. If no: continue modelling.