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

Can't use this to predict. #4

Open
NinelieAimer opened this issue Feb 18, 2021 · 1 comment
Open

Can't use this to predict. #4

NinelieAimer opened this issue Feb 18, 2021 · 1 comment

Comments

@NinelieAimer
Copy link

I'm sorry to bother you, I can't use your package to predict the results.
I can use this package to predict arma(4,0)-grach(1,1), but when I bulid arma(4,0)-grach(1,2) there is something wrong, please help me, I'm really in a hurry.

`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
----> 1 pred = model.predict(nsteps = 1)

D:\Anaconda\lib\site-packages\armagarch\empModel.py in predict(self, nsteps, params, data, other)
253 mPred = self._mean.predict(nsteps, params = pars[0], data = data, other = other)
254 # get prediction for volatility
--> 255 vPred = self._vol.predict(nsteps, params = pars[1], data = mdlres['et'], other = other)
256 return [mPred, vPred]
257

D:\Anaconda\lib\site-packages\armagarch\garch.py in predict(self, nsteps, params, data, other)
162 for t in range(nsteps):
163 if self._order['q']>0:
--> 164 prediction[t] = prediction[t] + laght[t:t+self._order['q']][::-1]@beta
165
166 if self._order['p']>0:

ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 1)`

@silkyrose
Copy link

I use the example code and got the following error:
Traceback (most recent call last):
File "D:/!paper/第六篇/newtxt/exp/getdata/predict.py", line 25, in
model.fit()
File "C:\Users\wj\Anaconda3\lib\site-packages\armagarch-1.0.2-py3.6.egg\armagarch\empModel.py", line 161, in fit
File "C:\Users\wj\Anaconda3\lib\site-packages\scipy\optimize\slsqp.py", line 208, in fmin_slsqp
constraints=cons, **opts)
File "C:\Users\wj\Anaconda3\lib\site-packages\scipy\optimize\slsqp.py", line 379, in _minimize_slsqp
fx = func(x)
File "C:\Users\wj\Anaconda3\lib\site-packages\scipy\optimize\optimize.py", line 293, in function_wrapper
return function(*(wrapper_args + args))

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

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

2 participants