Closed MHJS1958 closed 1 month ago
Please verify that you have the latest version of {fHMM}
(which is 1.3.1) and {oeli}
(which is 0.5.2) installed and try it again.
Thank you very much! I already have fHMM version 1.3.1, but upgrading oeli helped. However, I do not get the same results as you do on the same dataset as yours. The estimates are different and “Some confidence bounds could not be computed.” (15 missing), and then of course the figures look different!
Best regards
Michael.
It seems like the optimization did not converge properly. Please adapt your code as follows and try again:
library("fHMM")
dax <- download_data(symbol = "^GDAXI")
controls <- set_controls(
states = 3,
sdds = "t",
file = dax,
date_column = "Date",
data_column = "Close",
logreturns = TRUE,
from = "2000-01-01",
to = "2022-12-31",
runs = 100, # increases the number of numerical optimization runs
iterlim = 300, # increases the iteration limit for the optimizer
gradtol = 1e-6, # decreases the gradient tolerance for the optimizer
steptol = 1e-6 # decreases the tolerated step length for the optimizer
)
data <- prepare_data(controls)
summary(data)
library("doSNOW")
library("parallel")
detectCores()
model <- fit_model(data, seed = 1, ncluster = 10) # using parallel optimization to save computation time
When running this example from your introduction:
The execution stops with this error-message:
I cannot find a hint to solve this error, so can you please help ?