keblu / MSGARCH

MSGARCH R Package
https://cran.r-project.org/web/packages/MSGARCH/index.html
81 stars 28 forks source link

ExtractStateFit from FitMCMC #64

Open workersparty opened 4 years ago

workersparty commented 4 years ago

Hi Sir,

Thank you for writing this wonderful package.

I tried to run the code in the MSGARCH manual regarding ExtractStateFit:

# create model specification>
spec <- CreateSpec()
# load data
data("SMI", package = "MSGARCH")
# fit the model on the data with ML estimation
fit <- FitML(spec = spec, data = SMI)
SR.fit <- ExtractStateFit(fit)
print(SR.fit)

For FitML, it works.

However, when I try to do the same with FitMCMC, I get the following output and error:

# create model specification
spec <- CreateSpec()
# load data
data("SMI", package = "MSGARCH")
# fit the model on the data (here, I have changed to FitMCMC)

fit <- FitMCMC(spec = spec, data = SMI)
SR.fit <- ExtractStateFit(fit)

> SR.fit
[[1]]
Specification type: Single-regime
Specification name: sGARCH_norm
Number of parameters in variance model: 3
Number of parameters in distribution: 0
------------------------------------------
Posterior sample (size: 1000)

Error in summary(object$par)$stat[colnames(object$ctr$par0), ] : subscript out of bounds

How can I rectify this?

Thank you for your help.

keblu commented 3 years ago

Thx, will take a look. Sorry for the long delay, I haven't been focused on that project for the last several months.

KamiKazee17-KJ commented 1 year ago

Hello Sir, I am facing the same error. Any updates on this issue?