Time Series - Error Metrics


Advertisements

It is important for us to quantify the performance of a model to use it as a feedback and comparison. In this tutorial we have used one of the most popular error metric root mean squared error. There are various other error metrics available. This chapter discusses them in brief.

Mean Square Error

It is the average of square of difference between the predicted values and true values. Sklearn provides it as a function. It has the same units as the true and predicted values squared and is always positive.

$$MSE = \frac{1}{n} \displaystyle\sum\limits_{t=1}^n \lgroup y'_{t}\:-y_{t}\rgroup^{2}$$

Where $y'_{t}$ is the predicted value,

$y_{t}$ is the actual value, and

n is the total number of values in test set.

It is clear from the equation that MSE is more penalizing for larger errors, or the outliers.

Root Mean Square Error

It is the square root of the mean square error. It is also always positive and is in the range of the data.

$$RMSE = \sqrt{\frac{1}{n} \displaystyle\sum\limits_{t=1}^n \lgroup y'_{t}-y_{t}\rgroup ^2}$$

Where, $y'_{t}$ is predicted value

$y_{t}$ is actual value, and

n is total number of values in test set.

It is in the power of unity and hence is more interpretable as compared to MSE. RMSE is also more penalizing for larger errors. We have used RMSE metric in our tutorial.

Mean Absolute Error

It is the average of absolute difference between predicted values and true values. It has the same units as predicted and true value and is always positive.

$$MAE = \frac{1}{n}\displaystyle\sum\limits_{t=1}^{t=n} | y'{t}-y_{t}\lvert$$

Where, $y'_{t}$ is predicted value,

$y_{t}$ is actual value, and

n is total number of values in test set.

Mean Percentage Error

It is the percentage of average of absolute difference between predicted values and true values, divided by the true value.

$$MAPE = \frac{1}{n}\displaystyle\sum\limits_{t=1}^n\frac{y'_{t}-y_{t}}{y_{t}}*100\: \%$$

Where, $y'_{t}$ is predicted value,

$y_{t}$ is actual value and n is total number of values in test set.

However, the disadvantage of using this error is that the positive error and negative errors can offset each other. Hence mean absolute percentage error is used.

Mean Absolute Percentage Error

It is the percentage of average of absolute difference between predicted values and true values, divided by the true value.

$$MAPE = \frac{1}{n}\displaystyle\sum\limits_{t=1}^n\frac{|y'_{t}-y_{t}\lvert}{y_{t}}*100\: \%$$

Where $y'_{t}$ is predicted value

$y_{t}$ is actual value, and

n is total number of values in test set.

Useful Video Courses

Video

Java Date and Time Online Training

16 Lectures 2 hours

Malhar Lathkar

Video

Outsourcing Basics: How to Hire the Right Pros & Save Time!

21 Lectures 2.5 hours

Sasha Miller

Video

Google Search Operators: Save Time & Find Information Faster

19 Lectures 1 hours

Sasha Miller

Video

Time Series Analysis and Forecasting using Python

94 Lectures 13 hours

Abhishek And Pukhraj

Video

Effective Time Management Skills

12 Lectures 2 hours

Prof. Paul Cline, Ed.D

Advertisements