Discussion:
[pystatsmodels] Residuals of a fitted model
Georgios Boumis
2018-11-16 10:42:53 UTC
Permalink
How can I get the residuals out of this model?

mod=sarimax.SARIMAX(noxtrain,order=(1,0,0),seasonal_order=(1,1,0,24),enforce_stationarity=False,enforce_invertibility=False)
results=mod.fit()

It should be results.resid() right? But I get np.ndarray not callable...
Chad Fulton
2018-11-16 13:07:15 UTC
Permalink
Post by Georgios Boumis
How can I get the residuals out of this model?
mod=sarimax.SARIMAX(noxtrain,order=(1,0,0),seasonal_order=(1,1,0,24),enforce_stationarity=False,enforce_invertibility=False)
results=mod.fit()
It should be results.resid() right? But I get np.ndarray not callable...
Almost right. It’s actually just

results.resid

(It’s not a method, it’s a property)

Best,
Chad
Georgios Boumis
2018-11-16 19:08:08 UTC
Permalink
Thank you very much :-)
Post by Chad Fulton
Post by Georgios Boumis
How can I get the residuals out of this model?
mod=sarimax.SARIMAX(noxtrain,order=(1,0,0),seasonal_order=(1,1,0,24),enforce_stationarity=False,enforce_invertibility=False)
results=mod.fit()
It should be results.resid() right? But I get np.ndarray not callable...
Almost right. It’s actually just
results.resid
(It’s not a method, it’s a property)
Best,
Chad
Georgios Boumis
2018-11-17 20:55:36 UTC
Permalink
To continue, I try to see is the residuals are normally distributed and I
get a mean of -0.03 and σ=0.56. Q-Q plot seems good also but when I run a
Shapiro test it turns out my data are not normally distributed
Post by Georgios Boumis
How can I get the residuals out of this model?
mod=sarimax.SARIMAX(noxtrain,order=(1,0,0),seasonal_order=(1,1,0,24),enforce_stationarity=False,enforce_invertibility=False)
results=mod.fit()
It should be results.resid() right? But I get np.ndarray not callable...
Continue reading on narkive:
Loading...