Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'statsmodels.tsa' has no attribute 'arima' #7

Open
luca-palese opened this issue Aug 25, 2024 · 0 comments
Open

module 'statsmodels.tsa' has no attribute 'arima' #7

luca-palese opened this issue Aug 25, 2024 · 0 comments

Comments

@luca-palese
Copy link

Hi I just installed the armagarch lib ( thanks for that :) ) and I encountered this error:

import armagarch as ag
import matplotlib.pyplot as plt
import numpy as np

define mean, vol and distribution

meanMdl = ag.ARMA(order = {'AR':3,'MA':3})
volMdl = ag.garch(order = {'p':1,'q':1})
distMdl = ag.normalDist()

create a model

model = ag.empModel(dataframe['close'].to_frame(), meanMdl, volMdl, distMdl)

fit model

model.fit()

get the conditional mean

Ey = model.Ey

get conditional variance

ht = model.ht
cvol = np.sqrt(ht)

get standardized residuals

stres = model.stres

make a prediction of mean and variance over next 3 days.

pred = model.predict(nsteps = 3)

pred is a list of two-arrays with first array being prediction of mean

and second array being prediction of variance

AttributeError Traceback (most recent call last)
Cell In[3], line 14
12 model = ag.empModel(dataframe['close'].to_frame(), meanMdl, volMdl, distMdl)
13 # fit model
---> 14 model.fit()
16 # get the conditional mean
17 Ey = model.Ey

File c:\Users\Luca Palese\anaconda3\envs\ta-lib-env\lib\site-packages\armagarch\empModel.py:145, in empModel.fit(self, startingVals, epsilon, acc, iterations, iprint, printTable, estimatesOnly)
143 if startingVals is None:
144 if self._startingVals is None:
--> 145 startingVals = self._startVals()
146 else:
147 startingVals = self._startingVals

File c:\Users\Luca Palese\anaconda3\envs\ta-lib-env\lib\site-packages\armagarch\empModel.py:304, in empModel._startVals(self)
300 def _startVals(self):
301 """
302 Needs to be adjusted
303 """
--> 304 self._mean.data = self._data
305 meanStart = self._mean.startVals
306 volStart = self._vol.startVals
...
63 self._order['MA']), trend=c).fit()
64 if len(model.params) > self._pnum:
65 self._startingValues = model.params[:-1] # remove estimate of variance

AttributeError: module 'statsmodels.tsa' has no attribute 'arima'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant