Skip to content

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

@jcgtanaka

Description

@jcgtanaka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions