-
Notifications
You must be signed in to change notification settings - Fork 29
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
matrix multiplication: problem with matrix inverse; suggest to use solve() instead #67
Comments
I have just got the same error. I am using intraday (hour) returns as input. The estimation procedure replicate one in the paper:
If I set
The same code worked with daliy data! I can send you the data via e-mail. There are cca 25.000 rows. |
No,thank you! I noticed that you used the MLE.The same code worked with MLE in my problem. In addtion,when I changed the "eGARCH" to "sGARCH",the code succeed. |
@MicheleCai , I didn't try yo solve your problem. I have just posted the issues that was the same as yours :) I hope someone will answer soon. |
Typically, most estimation errors arise from issues with the data. First: is the return data (if this is stock return) scale by 100. There are some parameter bounds that are set in such a way that we assume that stock returns have been scaled by 100. Second, are there lots of zeros in the return? We have tested a lot with daily returns of highly liquid assets and estimation errors were very rare. A series with a lot of zeros in a row however is problematic, at least from what I have observed. Third, it is difficult to solve errors like that since it's often case by case. However, I noticed that the EGARCH GED model generates estimation errors more often than the other model. In any case, hard to fix unless you send me the code and data by email such that I can take a closer look. Often the fix is not changing the code, but setting up the data correctly. |
@keblu , I use hour returns on SPY as my data. First: When you say to scale the returns, you mean multiply by 100 (e.g. not 0.01 for 1% but 1)? Second: there are not a lot of zeroes but, as we talk about hour returns, they can be very close to 0 in short period. Third: I can send you code and data if you provide an email. |
@MicheleCai sorry, I cannot answer you by email since you sent it to my old one (only have redirection here and cannot get your full email address). Are you using the latest version of the package? My email should be updated here. If MLE works, I would suggest perhaps using the MLE parameters as the starting point for the MCMC chain, this might help. I see that you have a negative price from April of this year, which may be an issue as this is a very large outlier (-300 return when scaled). If you remove that observation, there is no error anymore for MCMC. Also, your time series is rather short (1000 obs), if you can, I would add data points prior to that. @MislavSag |
@keblu Can you please confirm that you got the mail? |
I have some problem with the code :
ms2.garch <- CreateSpec(variance.spec = list(model =c("eGARCH")),
distribution.spec = list(distribution = c("ged")),
switch.spec = list(do.mix=FALSE,K=2))
set.seed(12345)
fit.mcmc=FitMCMC(ms2.garch,data = z)
error: matrix multiplication: problem with matrix inverse; suggest to use solve() instead
Error in f_RCPP_adaptMCMC(theta0 = par0, acc_rate = 0.25, sigma = diag(length(par0)), :
Evaluation error: matrix multiplication: problem with matrix inverse; suggest to use solve() instead.
Can you help me solve the problem?
The text was updated successfully, but these errors were encountered: