UCSD Garch
DEPRECATED
The UCSD GARCH has been deprecated and will receive no further updates. Recent changes in MATLAB have broken many of the functions in the UCSD GARCH toolbox. Please use the MFE Toolbox which is the successor to the UCSD GARCH toolbox.
Legacy UCSD Toolbox¶
Before reporting bugs, please be sure you have the latest version, have downloaded the JPL toolbox, and ARE NOT using the ucsd_garch code from the JPL toolbox (and don't have that directory on your path)
The UCSD_Garch toolbox is a toolbox for Matlab that is useful in estimating and diagnosing univariate and multivariate heteroskedasticity in a Time Series models. The toolbox contains C-Mex files for the necessary loops in the univariate models. It is being released under a BSD style [license]. This means you can do pretty much what ever you want to including make money by selling it.
Updates¶
2.0.14: Thanks for Mark Flood who pointed out an old bug in fattailed garch. Even more reason to move to the MFE Toolbox if possible.
2.0.13: Thanks for Mark Flood who pointed out an initialization bug in full_bekk_simulate.
2.0.12: Thanks to Dennis Turk who pointed out a bug in garchcore.m.
2.0.11: I have updated the mex files to work with more modern versions of MATLAB and removed the 5.3 binaries. I also replaced the missing tarchcore.m so that all functions in the toolbox run with or without using the binary files.
2.0.10: New versions of bsds, bsds_studentized, block_bootstrap and stationary_bootstrap that use the latest version of Hansen's SPA paper
2.0.9.: Quite a few bug/inconsistencies squashed thanks to Paul Koufalas and Lance Young
2.0.8: 2 bugs in dcc_mvgarch and one in egarch squashed
2.0.7: A few more bugs squashed thanks to Hansen Chen
2.0.6: Fixed a couple of typos in the skewt garch functions
2.0.5: Fixed a bug in vech()
2.0.4: There is a Matlab limitation on filename length of 31 characters on some versions. dagonal_bekk_mvgarch_likelihood was 1 character too long. It has been renamed diagonalBekkMVgarchLikelihood.
2.0.4: A bug was found in GARCHINMEAN. It is now fixed.
2.0.3: A huge bug was found in EGARCH. The original file was using variances, not std devs. This is now fixed. Not> I am unable to build the 5.3 binary as I am out of the country. For now, egarchcore.dll is only available for 6 and above.
Note: A few last minute bugs have been caught and the toolbox has been fixed(Again!). Please fell free to contact ma about any errors you get at kevin.sheppard@economics.ox.ac.uk.
Help and Documentation¶
UCSD_GARCH Toolbox, Version 2.0.10 21-APR-2007
ucsd_garch_demo
- A demo of the garch toolbox
Main Univariate Mean Functions¶
armaxfilter
- Univariate ARMAX estimationmafilter
- Univariate MA estimationgarchinmean
- Univariate Garch-In-Mean estimation
Main Univariate GARCH Functions¶
garchpq_eviews
- Univariare GARCH estimation without lower bound constraints; uses a penalty funcion(similar to eviews)skewt_garch
- Univariat GARCH estimation with skew-t residuals(Hansen)tarch
- Univariate TARCH and GJR estimationgarchpq
- Univariate garch estimation with analytic derivativesfattailed_garch
- Univariate GARCH estimation with normal, Students T and Generalized Error Distributionmulti_garch
- Univariate GARCH proceeedure to estimate a variety of GARCH specifications including AP GARCHegarch
- Exponential garch estimation with normal, Students T and Generalized Error Distribution
Main Multivariate Functions¶
cc_mvgarch
- Estimates Bollerslev's Constant Correlation MV Garchdcc_mvgarch
- Estimates Engle and Sheppard's Dynamic Correlation MV Garcho_mvgarch
- Estimates Orthogonal or Factor MV Garchscalar_bekk_mvgarch
- Estimates Engle and Kroner's Scalar Bekk MV Garchdiagonal_bekk_mvgarch
- Estimates Engle and Kroner's Diagonal Bekk MV Garchfull_bekk_mvgarch
- Estimates Engle and Kroner's Bekk MV GarchIdcc_mvgarch
- Estimates Engle and Sheppards Integrated DCC MV Garchscalar_bekk_T_mvgarch
- Estimates Scalar Bekk MV Garch with Multivariate T disturbancesdiagonal_bekk_T_mvgarch
- Estimates Diagonal Bekk MV Garch with Multivariate T disturbancesfull_bekk_T_mvgarch
- Estimates Full Bekk MV Garch with Multivariate T disturbances
Univariate Mean and GARCH Simulation¶
armaxsimulate
- Simulate an ARMAX modelgarchsimulate
- Sumilate Univariate GARCH series with normal innovationsfattailed_garchsimulate
- Simulate Univariate GARCH series with Normal, Students T, or GED innovationsgarcheviewssimulate
- Simulate a GARCH process with (some)negative smoothing termsgarchinmeansimulate
- Simulate a garch in mean modelegarchsimulate
- Simulate an EGARCH modelmultigarchSimulate
- Simulate one of 8 different forms of GARCHdcc_univariate_simulate
- likelihood function called from dcc_univariate_simulate
Multivaraite GARCH Simulation¶
scalar_bekk_simulate
- Simulate a scalar BEKKdiagonal_bekk_simulate
- Simulate a diagonal BEKKfull_bekk_simulate
- Simulate a full BEKK modelcc_mvgarch_simulate
- Simulates Bollerslev's Constant Correlation MV Garchdcc_simulate
- Simulates Engle and Sheppard's Dynamic Correlation MV Garch
Univariate Mean Likelihood functions¶
garchinmeanlikelihood
- Likelihood funtion for garch in mean estimationmaxfilter_likelihood
- Likelihood function for MA estimationarmaxfilter_likelihood.m
- likelihood function called from armaxfilter
Univariate GARCH Likelihood Functions¶
garcheviewslikelihood
- likelihood function called from garchpq_eviewsskewt_garchlikelihood
- likelihood function called from skewt_garchskewtdis_LL
- Log likelihod of a skew T distribution(helper)garchlikelihood
- likelihood function called from garchpqfattailed_garchlikelihood
- likelihood function called from fattailed_garchmulti_garchlikelihood
- likelihood function called from multi_garchegarchlikelihood
- likelihood function called from egarch- `tarchlikelihood
Multivariate GARCH Likelihood Functions¶
cc_mvgarch_full_likelihood
- likelihood function called from cc_mvgarch_full_likelihooddcc_mvgarch_full_likelihood
- likelihood function called from dcc_mvgarch_full_likelihood(correct)dcc_mvgarch_likelihood
- likelihood function called from dcc_mvgarch_likelihood(restricted)diagonal_bekk_mvgarch_likelihood
- likelihood function called from diagonal_bekk_mvgarch_likelihoodfull_bekk_mvgarch_likelihood
- likelihood function called from full_bekk_mvgarch_likelihoodscalar_bekk_mvgarch_likelihood
- likelihood function called from scalar_bekk_mvgarch_likelihoodIdcc_mvgarch_full_likelihood
- likelihood function called from IDCC_mvgarch_likelihood(correct)Idcc_mvgarch_likelihood
- likelihood function called from IDCC_mvgarch_likelihood(used in estimation)scalar_bekk_T_est_likelihood
- likelihood function called from scalar_T_bekk_mvgarch_likelihood(used in estimation)diagonal_bekk_T_est_likelihood
- likelihood function called from diagonal_T_bekk_mvgarch_likelihood(used in estimation)full_bekk_T_est_likelihood
- likelihood function called from full_T_bekk_mvgarch_likelihood(used in estimation)scalar_bekk_T_likelihood
- likelihood function called from scalar_T_bekk_mvgarch_likelihood(correct)diagonal_bekk_T_likelihood
- likelihood function called from diagonal_T_bekk_mvgarch_likelihood(correct)full_bekk_T_likelihood
- likelihood function called from full_T_bekk_mvgarch_likelihood(correct)
Diagnostics¶
dcc_mvgarch_test
- Engle and Sheppards test for dynamic correlationlilliefors
- Lillifors test for normalityljq2
- Ljung-Box Q Testlmtest1
- Lagrange Multiplier Test for autocorrelationlmtest2
- Lagrange Multiplier Test for autocorrelation in the squarred residuals, an ARCH testjarquebera
- Jarque-Bera test for normalityshapirowilks
- Shapiro-Wilks Test for normalityshapirofrancia
- Shapiro-Francia Test for normalitykolmogorov
- Kolmorogov-Shmirnov non-parametric testberkowitz
- The berkowitz transform of the KS test
Kernel Smoothing Routines¶
cosinus
- Cosinus kernelepanechnikov
- Epanechnikov kernelkern_dens_contour
- Bivariate kernel density plot of a density contourkern_dens_plot
- Univariate kernel density plotkern_dens_plot2
- 3d bivariate kernel density plotnormal
- Normal kernelquartic
- Quaritc kerneltriangular
- Triangular kerneltriweight
- Triweight kerneluniform
- Uniform kernel
Bootstrap Routines¶
block_bootstrap
- Block time series bootstrapbsds
- Bootstrap Data Snooper(White 2000, Hansen 2001) with upper, lower and consistent pvalsbsds_studentized
- Bootstrap Data Snooper, using studentized bootstraps(Hansen 2001)cont_bootstrap
- Continuous Bootstrap for unit root datastationary_bootstrap
- Stationary Bootstrap(Politis and Romano(1994)) for time series
Univariate Density Functions¶
exppowcdf
- Exponential Power Cumulative Density Functionexppowrnd
- Exponential Power Random number generatorexppowpdf
- Exponential Power Random Probability Density Functiongedcdf
- Generalized Error Distribution Cumulative Density Functiongedinv
- Generalized Error Distribution Inverse CDFgedpdf
- Generalized Error Distribution Probability Density Functiongedrnd
- Generalized Error Distribution Random Number Generatorskewtdis_cdf
- Skew-T Cumulative Density Functionskewtdis_inv
- Skew-T Inverse CDFskewtdis_pdf
- Skew-T Probability Density Functionskewtdis_rnd
- Skew-T Random Number Generatorstdtdis_cdf
- Standardized T distribution(unit variance for all nu) Cumulative Density Functionstdtdis_pdf
- Standardized T distribution(unit variance for all nu) Probability Density Functionstdtdis_rnd
- Standardized T distribution(unit variance for all nu) Random Number Generator
Helper Functions¶
kscritical
- Lookup table for KS critical valuescc_ivech
- Specialized ivech for correlation matricesfx.mat
- a data set for foreign exchange return used by the demosmulti_garch_paramsetup
- helper function for multi_garchmulti_garch_constraints
- helper function for multi_garchdcc_hessian
- A modified version of HESSIAN for use in with CC_MVGARCH and DCC_MVGARCHivech
- Creates a square lower triangular matrix, inverse of vechvech
- Takes teh half-vec of a square matrix, inverse of ivechlagmatrix
- Returns a matrix of lags of a dependant variablepca
- Performs Principal Componet Analysis
C-MEX functions(should be compilable using any C compiler, binaries for Win32 provided) NOTE: WHILE .M FILESARE AVAILABLE FOR ALL OF THESE, YOU SHOULD COMPILE THESE OR USE THE PROVIDED BINARIES BINARIES END IN .DLL, MATLAB FUNCTIONS END IN .M, AND SOURCE ENDS IN .C
armaxcore
- Core routine for ARMAXegarchcore
- Core routine for EGARCHgarchcore
- Core routine for GARCH and FATTAILED_GARCHgarchgrad
- Core routine for GARCH derivative estimationgarchinmeancore
- Core routine for Garch in mean estimationmultigarchcore
- Core routine for MULTIGARCHivech
- C version of ivechvech
- C version of vechmaxcore
- Core routing for MA estimationrecserarcore
- C core for recserartarchcore
- Core routine for TARCH estimationmultigarchcore
- Core routine for MULTIGARCH
NOTE: This toolbox requires both MATLAB optimization toolbox and the excellent J.P.LeSage Library available from www.spatial-econometrics.com
Copyright (c) 2001-2007 Kevin Sheppard All Rights Reserved.
License¶
All of the documentation and software included in the UCSD_Garch toolbox for Matlab is copyrighted by Kevin Sheppard.
Copyright 2001-2007 Kevin Sheppard
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the Kevin Sheppard. Neither the name of the University of California at San Diego nor Kevin Sheppard may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY KEVIN SHEPPARD ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEVIN SHEPPARD OR UCSD OR THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the Regents of the University of California or UCSD.
Please feel free to contact the author at kevin.k.sheppard with comments, suggestions, or bugfixes.