Skip to main content
edited tags
Link
deleted 15 characters in body
Source Link

I am trying to manually replicate forecasts obtained by SARIMAX(0,1,1)(1,0,1,12) statsmodels v0.12.2 predict method.

You can find the dataset here.
You can find the code to get forecasts based on model and equation here

Following is the result summary from statsmodels: enter image description here

Considering the equation below for the SARIMAX(0,1,1)(1,0,1,12) to manually replicate the forecasts.

$ {SARIMAX(0,1,1)(1,0,1)_{12}} \\ y_i = {\Phi}_1*y_{i-12} + {\theta}_1*\epsilon_{i-1} + {\Theta}_1*\epsilon_{i-12}+ {\theta}_1*{\Theta}_1*\epsilon_{i-1}*\epsilon_{i-12} $$ {SARIMAX(0,1,1)(1,0,1)_{12}} \\ y_i = {\Phi}_1*y_{i-12} + {\theta}_1*\epsilon_{i-1} + {\Theta}_1*\epsilon_{i-12}+ {\theta}_1*{\Theta}_1*\epsilon_{i-13} $

Above mentioned code does the following:

  1. Fits SARIMAX model on data and gets predictions for the next 4 quarters
  2. Fetch the model parameters ma.L1, ar.S.L12, ma.S.L12 to build equation
  3. Difference the revenue data and get residuals from result.resid
  4. Run forecasts using the equation
  5. Compare the results

enter image description here enter image description here

As you can the see the above plot, there is a slight difference in predictions from model vs the predictions from equation. Not sure wherewhat I am going wrongmissing here!

PS: I have seen other articles similar to this but I couldn't sort this out. Any help would be greatly appreciated.

I am trying to manually replicate forecasts obtained by SARIMAX(0,1,1)(1,0,1,12) statsmodels v0.12.2 predict method.

You can find the dataset here.
You can find the code to get forecasts based on model and equation here

Following is the result summary from statsmodels: enter image description here

Considering the equation below for the SARIMAX(0,1,1)(1,0,1,12) to manually replicate the forecasts.

$ {SARIMAX(0,1,1)(1,0,1)_{12}} \\ y_i = {\Phi}_1*y_{i-12} + {\theta}_1*\epsilon_{i-1} + {\Theta}_1*\epsilon_{i-12}+ {\theta}_1*{\Theta}_1*\epsilon_{i-1}*\epsilon_{i-12} $

Above mentioned code does the following:

  1. Fits SARIMAX model on data and gets predictions for the next 4 quarters
  2. Fetch the model parameters ma.L1, ar.S.L12, ma.S.L12 to build equation
  3. Difference the revenue data and get residuals from result.resid
  4. Run forecasts using the equation
  5. Compare the results

enter image description here enter image description here

As you can the see the above plot, there is a slight difference in predictions from model vs the predictions from equation. Not sure where I am going wrong!

PS: I have seen other articles similar to this but I couldn't sort this out. Any help would be greatly appreciated.

I am trying to manually replicate forecasts obtained by SARIMAX(0,1,1)(1,0,1,12) statsmodels v0.12.2 predict method.

You can find the dataset here.
You can find the code to get forecasts based on model and equation here

Following is the result summary from statsmodels: enter image description here

Considering the equation below for the SARIMAX(0,1,1)(1,0,1,12) to manually replicate the forecasts.

$ {SARIMAX(0,1,1)(1,0,1)_{12}} \\ y_i = {\Phi}_1*y_{i-12} + {\theta}_1*\epsilon_{i-1} + {\Theta}_1*\epsilon_{i-12}+ {\theta}_1*{\Theta}_1*\epsilon_{i-13} $

Above mentioned code does the following:

  1. Fits SARIMAX model on data and gets predictions for the next 4 quarters
  2. Fetch the model parameters ma.L1, ar.S.L12, ma.S.L12 to build equation
  3. Difference the revenue data and get residuals from result.resid
  4. Run forecasts using the equation
  5. Compare the results

enter image description here enter image description here

As you can the see the above plot, there is a slight difference in predictions from model vs the predictions from equation. Not sure what I am missing here!

PS: I have seen other articles similar to this but I couldn't sort this out. Any help would be greatly appreciated.

Source Link

Unable to replicate forecasts manually for SARIMAX

I am trying to manually replicate forecasts obtained by SARIMAX(0,1,1)(1,0,1,12) statsmodels v0.12.2 predict method.

You can find the dataset here.
You can find the code to get forecasts based on model and equation here

Following is the result summary from statsmodels: enter image description here

Considering the equation below for the SARIMAX(0,1,1)(1,0,1,12) to manually replicate the forecasts.

$ {SARIMAX(0,1,1)(1,0,1)_{12}} \\ y_i = {\Phi}_1*y_{i-12} + {\theta}_1*\epsilon_{i-1} + {\Theta}_1*\epsilon_{i-12}+ {\theta}_1*{\Theta}_1*\epsilon_{i-1}*\epsilon_{i-12} $

Above mentioned code does the following:

  1. Fits SARIMAX model on data and gets predictions for the next 4 quarters
  2. Fetch the model parameters ma.L1, ar.S.L12, ma.S.L12 to build equation
  3. Difference the revenue data and get residuals from result.resid
  4. Run forecasts using the equation
  5. Compare the results

enter image description here enter image description here

As you can the see the above plot, there is a slight difference in predictions from model vs the predictions from equation. Not sure where I am going wrong!

PS: I have seen other articles similar to this but I couldn't sort this out. Any help would be greatly appreciated.