Residuals are the indicator of the model quality. Based on Rob J Hyndman's book "Forecasting: Principles & Practice", residuals in forecasting is difference between observed value and its forecast based on all previous observations. Residuals are useful in checking whether a model has adequately captured the information in the data. All the patterns should be in the model, only randomness remains in the residuals. Therefore the ideal model has to be: uncorrelated has zero mean and useful properties are: constant variance be normally distributed First I will activate some useful libraries we will be using. library(fpp) library(forecast) For our example I will use dowjones index as a data set. The idea will be to set up already well know simple models like: Mean Model, Naive model and Drift Model. In previous post I described it more detailed. Next, knowing what attributes the ideal model should have we can check which one of those 3 are quite good or def...
Let's use some of the statistics I mentioned before to describe some Time Series. We can start with Dow Jones dataset which are in fpp library. Dataset containing the Dow Jones Index is a stock market index that measures the stock performance of 30 large companies listed on stock exchanges in the United States. library(fpp) dowjones # It is our dataset, which has class ts so we don't have to convert it. Time Series: Start = 1 End = 78 Frequency = 1 [1] 110.94 110.69 110.43 110.56 110.75 110.84 110.46 110.56 110.46 110.05 109.60 109.31 109.31 109.25 [15] 109.02 108.54 108.77 109.02 109.44 109.38 109.53 109.89 110.56 110.56 110.72 111.23 111.48 111.58 [29] 111.90 112.19 112.06 111.96 111.68 111.36 111.42 112.00 112.22 112.70 113.15 114.36 114.65 115.06 [43] 115.86 116.40 116.44 116.88 118.07 118.51 119.28 119.79 119.70 119.28 119.66 120.14 120.97 121.13 [57] 121.55 121.96 122.26 123.79 124.11 124.14 123.37 123.02 122.86 123.02 123.11 123.05 123.05...