'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.
 A: 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: 


*

*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.

*Is there remaining auto-correlation in the residuals? Yes: add AR or MA terms, or change model along different avenues. No: you're good.

*Look at histogram of residuals: do they look normal? Is their mean equal to zero? If yes: you're fine. If no: continue modelling.


Without more info, that's all I can tell you.
p.s. Unfortunately the words error and residual are often used loosely and interchangeably. Idem: prediction and forecast. Residuals are observed and are estimates of error, a random variable. Forecast always refers to a prediction into the future.
p.p.s. It is good practice to report the Mean Squared Prediction Error [MSPE] instead of the Sum of Squared (Prediction) Residuals [SSR]. 
