Description Usage Arguments Value Author(s) References See Also Examples
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))
1 | MS_Regress_For(myModel, newIndep)
|
myModel |
A S4 object obtained with MS_Regress_Fit |
newIndep |
A new set of independent/explanatory variables |
The function returns a list with the following items:
$condMean |
Conditional Mean for t+1 |
$condStd |
Conditional Standard Deviation in t+1 |
Marcelo Perlin - ICMA/UK <marceloperlin@gmail.com>
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
MS_Regress_Simul
,MS_Regress_Fit
,MS_Regress_Lik
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.