Accuracy assessment

Just like with the prediction of continuous and categorical variables in the previous two chapters, honest assessments of model accuracy is of the upmost importance.

The typical first step in the assessment of forecasts is a thorough analysis of the residuals (again, the difference between the values the model gives and the actual observed values). This often includes plotting a histogram of the residuals (to check for a zero mean and symmetric distribution) and an ACF plot (to verify that there is no serial correlation in the residuals). Additionally, a great thing to do is to run a Ljung-Box test on the residuals to more qualitatively check for serial correlation. Luckily for us, the forecast package provides a function,  ...

Get Data Analysis with R - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.