Skip to content

Not able to output the forecasted price returns from the "predict" method #79

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

Open
jcgtanaka opened this issue Apr 3, 2025 · 0 comments

Comments

@jcgtanaka
Copy link

Hello guys!

Greetings from Lima, Peru, South America

I've run the predict method as:
#############################
``

Load required libraries

library(quantmod)
library(MSGARCH)
library(zoo)
library(ggplot2)
library(tidyr)
library(comprehenr)

Import data from Yahoo Finance

getSymbols('MSFT', src = 'yahoo', from = "1990-01-01", to = "2023-08-26")

Calculate daily log returns

returns <- diff(log(Ad(MSFT)))[-1]
colnames(returns) <- "returns"

spec <- CreateSpec(
variance.spec = list(model = c("sGARCH", "sGARCH", "sGARCH")),
distribution.spec = list(distribution = c("std", "std", "std")),
switch.spec = list(do.mix = FALSE)
)

fit <- FitML(spec, data = as.numeric(returns))

pred <- predict(object = fit, nahead = 1L, do.return.draw = TRUE)
``
########################

Even though I set do.return.draw to TRUE, I'm not able to have the predicted draws.

Could you please fix that?

Thanks and Regards,

José Carlos

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

1 participant