I am following a tutorial building an AR model
using ARMA
model from statsmodels.tsa.arima_model
, I got an error that it has been deprecated, and it is replaced by ARIMA
from statsmodels.tsa.arima.model
. I am trying to write a function that calculate a test statistic of the log-likelihood ratio test, which requires the use of the llf
attribute of an initialized ARMA
model. I do not know what is the counterpart of llf
attribute in ARIMA
model?
I tried statsmodels.tsa.arima.model.ARIMA.fit().loglike()
but I did not know what kind of parameter it should get?
ar_2_model = ARIMA(data, order=(2,0,0) ).fit()
I tried ar_2_model.loglike()
, but I could not figure out what kind of parameters to pass to it.
I want to get the value of the log-likelihood function of ar_2_model
as similar to if I would have used
ar_3_model = ARMA(data. order=(2,0)).fit()
ll_f = ar_3_model.llf
You can still use llf
:
ar_2_model = ARIMA(data, order=(2,0,0) ).fit()
print(ar_2_model.llf)