| File Information |
| Description |
This submission provides functions (and examples scripts) for estimation, simulation and forecasting of a general Markov Regime Switching Regression.
Features of the package:
- Support for univariate and multivariate models.
- Support of any number of states and any number of explanatory variables.
- Estimation, by maximum likelihood, of any type of switching setup for the model. This means that you can choose which coefficients in the model, including distribution parameters, are switching states over time.
- A wrapper function for the estimation of regime switching autoregressive models, including multivariate case (MS-VAR) is included in the package.
- The values of standard error for the estimated coefficients can be calculated with 4 different methods.
- Includes a C version of hamilton’s filter that may be used for speeding up the estimation function (see pdf for details).
- Possibility of three distinct distribution assumptions for residual vector (Normal, t or GED).
- Support for reduced/constrained estimation (see pdf document for details).
- Loads of example scripts.
Limitations of the Package (so far):
- The EM algorithm is not implemented (all models are estimated by direct maximization of log likelihood function).
- It doesn’t support state space models with markov switching effects.
- It cannot estimate a model with time varying transition probabilities (TVPT).
- It doesn’t support models with garch type of filters for conditional volatility.
Here a few references in Markov Switching models:
ALEXANDER, C. (2008) ‘Market Risk Analysis: Practical Financial Econometrics’ Wiley.
BROOKS, C. (2002) ‘Introduction to Econometrics’ Cambridge University Press.
HAMILTON, J., D. (2005) Regime Switching Models. Palgrave Dictionary of Economics, (available at http://dss.ucsd.edu/~jhamilto/palgrav1.pdf )
HAMILTON, J., D. (1994) ‘Time Series Analysis’ Princeton University Press.
KIM, C., J., NELSON, C., R. (1999) State Space Model with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications. The MIT press.
Make sure you read the file About_the_MS_Regression_Models.pdf within the downloaded zip file. There you can find details regarding the structure of the package, along with instructions of how to use it.
I also wrote a R/S+ version of the package (fMarkovSwitching). It is available within the Rmetrics project: http://r-forge.r-project.org/projects/rmetrics/.
Fell free to send any comments/suggestions to my email.
|
| Required Products |
Optimization Toolbox
Statistics Toolbox
|
| MATLAB release |
MATLAB 7.2 (R2006a)
|
| Zip File Content |
|
| Other Files |
license.txt, MS_Regress_FEX/About_the_MS_Regression_Models.pdf, MS_Regress_FEX/Example_MS_Regress_Fit.m, MS_Regress_FEX/Example_MS_Regress_Fit_GED_Dist.m, MS_Regress_FEX/Example_MS_Regress_Fit_MSVAR.m, MS_Regress_FEX/Example_MS_Regress_Fit_MultiVar.m, MS_Regress_FEX/Example_MS_Regress_Fit_t_Dist.m, MS_Regress_FEX/Example_MS_Regress_Fit_using_constCoeff.m, MS_Regress_FEX/Example_MS_Regress_Fit_with_MEX.m, MS_Regress_FEX/Example_MS_Regress_Simul_2_States_Multivar.m, MS_Regress_FEX/Example_MS_Regress_Simul_3_States.m, MS_Regress_FEX/Example_MS_Regress_Simul_and_Fit_2_States.m, MS_Regress_FEX/Example_MS_Regress_Simul_and_Fit_3_States.m, MS_Regress_FEX/Example_MS_Regress_Simul_Fit_2_States_Multivar.m, MS_Regress_FEX/m_Files/build_constCoeff.m, MS_Regress_FEX/m_Files/check_constCoeff.m, MS_Regress_FEX/m_Files/checkInputs.m, MS_Regress_FEX/m_Files/checkSize_constCoeff.m, MS_Regress_FEX/m_Files/confuneq_MS_Regress.m, MS_Regress_FEX/m_Files/doOutScreen.m, MS_Regress_FEX/m_Files/doOutScreen_MSVAR.m, MS_Regress_FEX/m_Files/doPlots.m, MS_Regress_FEX/m_Files/getvarMatrix_MS_Regress.m, MS_Regress_FEX/m_Files/mex_MS_Filter.cpp, MS_Regress_FEX/m_Files/mex_MS_Filter.mexw32, MS_Regress_FEX/m_Files/MS_Regress_Fit.m, MS_Regress_FEX/m_Files/MS_Regress_For.m, MS_Regress_FEX/m_Files/MS_Regress_Lik.m, MS_Regress_FEX/m_Files/MS_Regress_Sim.m, MS_Regress_FEX/m_Files/MS_VAR_Fit.m, MS_Regress_FEX/m_Files/mvnpdf_MSPERLIN.m, MS_Regress_FEX/m_Files/myMVNPDF.m, MS_Regress_FEX/m_Files/nr3matlab.h, MS_Regress_FEX/m_Files/param2spec.m, MS_Regress_FEX/m_Files/preCalc_MSModel.m, MS_Regress_FEX/m_Files/spec2param.m, MS_Regress_FEX/matFiles/Example_FEX.mat, MS_Regress_FEX/matFiles/GNP_Hamilton.mat, MS_Regress_FEX/Script_Hamilton_Comparison.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 30 Aug 2007 |
* Fixed Description and organized the m files in folders |
| 19 Sep 2007 |
* Added simulation and forecasting functions and scripts |
| 08 Oct 2007 |
* Changed output format of transition Matrix |
| 05 Nov 2007 |
Fixed small bug with MS_AR_FOR.m (I changed the probabilities name at Spec struct and forgot to also change it at MS_AR_FOR.m) |
| 21 Nov 2007 |
* Added choice of distribution for estimation (normal or t) with example scripts. * Added a pdf document (details at summary). * added calculation of conditional mean and conditional std at output |
| 26 Nov 2007 |
* Fixed gramatical errors at description |
| 16 Jan 2008 |
* Fixed a Bug at MS_Regress_For (thanks Mr. Panagiotis Papanastasiou-Ballis). * Added a spreadsheet with different outputs from different matlab versions |
| 16 Jan 2008 |
Change in description of the submission and inclusion of data (and script) for Professor's Hardy MS spreadsheet (more detais at description) |
| 21 Jan 2008 |
Added calculation of standard errors by White (1984) and Newey and West (1987) and also changed a lot of the inputs structure (check the new example files). |
| 05 Mar 2008 |
Fixed some grammatical errors at pdf documentation and also fixed small bug at calculation of smoothed (and not filtered) probabilities |
| 21 Apr 2008 |
Fixed some name clashes with the other ms package. Changed a couple of other things, nothing special. |
| 29 Apr 2008 |
Implemented mex version of hamilton's filter. The gain in speed is quite impressive (5x-8x times the original version). For instructions of how to use it, please check pdf documentation. |
| 09 Jun 2008 |
Fixed but at standard error calculation. Thanks Axel Gro |
| 22 Jul 2008 |
Added a few for features and fixed major bug at calculation of standard errors. All merits to Steve Guo for finding and fixing it. Thanks for the code you sended, they were of great help. |
| 25 Jul 2008 |
Resend the files (last update didnt went through) |
| 05 Aug 2008 |
Fixed the code for cases where a very small transition probability led the partial derivatives to zero. This means no more NaN values at the standard errors. |
| 07 Aug 2008 |
fixed small mistake at the display of results |
| 29 Sep 2008 |
Added the p values of coefficients in the output |
| 09 Nov 2008 |
Changed a few things in pdf file, along with output to screen format of transition matrix. |
| 15 Dec 2008 |
Small change at description (link to R version of package) |
| 25 Feb 2009 |
* Added GED Distribution in MS_Regress_fit.m. * Added the flexibility of choosing wheter distribution parameters will switch state or not. |
| 25 Feb 2009 |
* added GED distribution to MS_regress_fit, * Added the possibility of choosing if distribution parameters will switch or not. |
| 23 Mar 2009 |
Added the possibility of contrained estimation (see pdf for details) |
| 07 Apr 2009 |
Changed Description of Package. |
| 16 Apr 2009 |
Fixed bug on MS_Regress_Fit |
| 03 May 2009 |
Increased the robustness of the estimation function regarding different scales of variables. Changed a few things in manual and FEX description. |
| 28 May 2009 |
fix in reference link |
| 04 Jun 2009 |
Added a section in the Manual (and scripts) for estimating Hamilton's model |
| 11 Jun 2009 |
Fixed small typo in MS_Regress_Fot and added a few things in manual. |
| 13 Jun 2009 |
Fixed another typo due to update in notation |
| 21 Jun 2009 |
A couple of improvements in Manual. |
| 27 Oct 2009 |
Added support for multivariate models and autoregressive specifications, including MS VAR. See pdf for details. |
| 31 Jan 2010 |
Fixed bug for the cases where simulation model only had switching variables. Included a missing script for comparison against hamilton's model. |
| 01 Feb 2010 |
Fixed cases where there was an error for a simulation model with no non switching parameters (see comments by Aaron). Added a couple of more things in input checking. |
|