Description Usage Arguments Value Note Author(s) References See Also Examples
This function will estimate by maximum likelihood a univariate MS model based on input arguments
1 | MS_Regress_Fit(dep, indep, S, k = 2, distIn = "Normal")
|
dep |
The dependent/explained variable (a vector) |
indep |
the independent/explanatory variables (a matrix) |
S |
Input argument which controls which indep variables switch (see documentation for more details) |
k |
Number of states in MS model (a positive integer, e.g. |
distIn |
Assumed distribution for residue ("Normal" or "t") |
Returns a S4 "MS_Model" object the following slots:
@filtProb |
A matrix with the filtered probabilities from the Model |
@smoothProb |
A matrix with the smooth probabilities from the Model (Kim's algorithm) |
@Coeff |
A list structure with all estimated coefficients (see documentation for more details) |
@CondMean |
A matrix of fitted conditional means, conditional on the probabilities of t<a6>t |
@Coeff_Std |
A list with standard errors of coefficients (with same members as @Coeff) |
@LL |
The maximum log likelihood found by optimizing algorithm |
@k |
The number of states in MS model |
@paramVec |
Estimated parameters in vector notation (with the same values as @Coeff |
@stateDur |
The Expected duration of each regime |
@nParameter |
The number of parameters in the model |
@nParameter |
The number of parameters in the model |
@sizeModel |
A list with the size of the estimated model (see documentation for details) |
@distrib |
The distribution assumption ("Normal" or "t") |
A MatLab version of the code is also available. See matlab exchange site (http://www.mathworks.com/matlabcentral/fileexchange/15789)
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_For
,MS_Regress_Lik
1 2 3 4 5 6 7 8 9 10 11 12 | # defining some data (from package)
data(indep)
data(dep)
S<-c(1,0,0) # where to switch (in this case in the olny indep)
k<-2 # number of states
distIn<-"Normal"#distribution assumption
myModel<-MS_Regress_Fit(dep,indep,S,k) # fitting the model
print(myModel) # printing output
plot(myModel) # plotting output
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.