Closed schoulten closed 2 weeks ago
The source code in plot_residuals() calculate the residuals as follows:
plot_residuals()
https://github.com/JoaquinAmatRodrigo/skforecast/blob/310915dc5b07b82acd731f43ab0f6b776ba5c6fd/skforecast/plot/plot.py#L59
But according to Rob Hyndman's book (FPP3), the correct calculation should be:
$$e{T+h} = y{T+h} - \hat{y}_{T+h|T}$$
Where $y{T+h}$ are the "Ground truth (correct) values" and $\hat{y}{T+h|T}$ are the "Values of predictions"
So, the above code should change to:
residuals = y_true - y_pred
You are right, thanks for reporting!
Fixed in https://github.com/JoaquinAmatRodrigo/skforecast/pull/702
The source code in
plot_residuals()
calculate the residuals as follows:https://github.com/JoaquinAmatRodrigo/skforecast/blob/310915dc5b07b82acd731f43ab0f6b776ba5c6fd/skforecast/plot/plot.py#L59
But according to Rob Hyndman's book (FPP3), the correct calculation should be:
$$e{T+h} = y{T+h} - \hat{y}_{T+h|T}$$
Where $y{T+h}$ are the "Ground truth (correct) values" and $\hat{y}{T+h|T}$ are the "Values of predictions"
So, the above code should change to: