i want to do predict using R studio for MSVAR model

data_returns <- data.frame(bri_returns, ihsg_returns)
data_matrix <- cbind(bri_returns, ihsg_returns) colnames(data_matrix) <- c(“BBRI_Returns”, “IHSG_Returns”)

var_model <- VAR(data_matrix, p = aic_lag)

lm_model <- lm(ihsg_returns ~ _returns, data = data_returns)

msvar <- msmFit(lm_model, k = 2, sw = rep(TRUE, 3))
summary(msvar)

coefficients_list <- msvar@Coefprint(coefficients_list)

transition_matrix <- msvar@transMatprint(transition_matrix)

msvar@Fit@smoProb
par(mar=c(3,3,3,3))
plotProb(msvar, which=1)
plotProb(msvar, which=2)

plotDiag(msvar, regime=1, which=1)
plotDiag(msvar, regime=1, which=2)
plotDiag(msvar, regime=1, which=3)

plotDiag(msvar, regime=2, which=1)
plotDiag(msvar, regime=2, which=2)
plotDiag(msvar, regime=2, which=3)

i cant find predict in the package msmFit , so please help me.

Read more here: Source link