MS_Regress_For: Function to Forecast a Markov Switching Model in t+1

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function will take as input a MS_Model object, the new set of explanatory variables and then forecast in t+1 the conditional mean and standard deviation of the model based on the filtered probabilities (conditional on t-1 (t<a6>t-1))

Usage

1
MS_Regress_For(myModel, newIndep)

Arguments

myModel

A S4 object obtained with MS_Regress_Fit

newIndep

A new set of independent/explanatory variables

Value

The function returns a list with the following items:

$condMean

Conditional Mean for t+1

$condStd

Conditional Standard Deviation in t+1

Author(s)

Marcelo Perlin - ICMA/UK <marceloperlin@gmail.com>

References

ALEXANDER, C. (2008) 'Market Risk Analysis: Practical Financial Econometrics' Wiley
HAMILTON, J., D. (1994) 'Time Series Analysis' Princeton University Press
HAMILTON, J., D. (2005) 'Regime Switching Models' Palgrave Dictionary of Economic
KIM, C., J., NELSON, C., R. (1999) 'State Space Model with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications' The MIT press

See Also

MS_Regress_Simul,MS_Regress_Fit,MS_Regress_Lik

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
data(dep)
data(indep)

dep=as.matrix(dep)
indep=as.matrix(indep)

# input arguments

S=c(1,0,0)
distrib<-"Normal"
k<-2

# new dep and indep (without last observation, which will be forecasted)

dep=dep[-nrow(dep)]        
myNewIndep=indep[-nrow(indep),]

# Fit the model with ex ante data

myModel<-MS_Regress_Fit(dep,myNewIndep,S,k,distrib)

# new indep matrix is build as the last observations

newIndep_For=as.matrix(t(indep[nrow(indep),])) 

# forecast with MS_Regress_For

myFor<-MS_Regress_For(myModel,newIndep_For)

cat("\nForecast for conditional Mean in t+1= ",myFor$condMean,"\n")
cat("Forecast for conditional Standard deviation (sigma) in t+1= ",myFor$condStd,"\n")

fMarkovSwitching documentation built on May 2, 2019, 5:58 p.m.