Closed filippocuscito29 closed 3 years ago
How did you specify your controls? Please provide a minimal reproducible example.
Here is the code:
download_data(name = "Copper", symbol = "HG=F", path = ".")
controls = list(path = ".", id = "HHMM_3_2_COPPER_t", model = "hhmm", states = c(3,2), sdds = c("t", "t"), horizon = c(30, "w"), data = list("source" = c("coarse", "fine"), "column" = c("Close", "Close"), "cs_transform" = function(x) (tail(x,1)-head(x,1))/head(x,1), "log_returns" = c(FALSE, TRUE), "truncate" = c("2000-01-01", NA)), fit = list("runs" = 100))
events = list(dates = c("2008-07-01"), names = ("73 days to Lehman crash"))
fit_hmm(controls, events)
Looking forward to hearing from you. I really do not understand what I am getting wrong.
You misspecified controls$data$source
. You need the name of the .csv file with your data there. The following worked for me:
install.packages("fHMM")
library("fHMM")
download_data(name = "Copper", symbol = "HG=F", path = ".")
controls = list(path = ".",
id = "HHMM_3_2_COPPER_t",
model = "hhmm", states = c(3,2),
sdds = c("t", "t"),
horizon = c(30, "w"),
data = list("source" = c("copper.csv", "copper.csv"),
"column" = c("Close", "Close"),
"cs_transform" = function(x) (tail(x,1)-head(x,1))/head(x,1),
"log_returns" = c(FALSE, TRUE),
"truncate" = c("2000-01-01", NA)),
fit = list("runs" = 100))
events = list(dates = c("2008-07-01"), names = ("73 days to Lehman crash"))
fit_hmm(controls, events)
Hi,
I am trying to fit an hhmm on copper data, however, after
the following error pops up:
Error in check_controls(controls): File './data/x.csv' not found.
Thank you in advance for the support.