Panel GARCH with dummy variable

Discussions of ARCH, GARCH, and related models
Ameer
Posts: 3
Joined: Sun Nov 11, 2018 12:22 pm

Panel GARCH with dummy variable

Unread post by Ameer »

Dear Tom
I'm a new user of RATS and I have been trying to understand its coding system since few days, now I need to run Panel GARCH model with three dummy variables for panel data on weekly stock prices of 15 countries, the dummies stand for the periods when the capital inflows are either high, low or normal. I want to check whether the conditional variance of stock prices have significant changes during these periods or not.
DATA(FORMAT=XLSX,ORG=COLUMNS) 1//2000:01:05 2//2088:09:22 index TSD TOD TND
The variables TSD, TOD and TND represent the dummy variables.

I got the code of Panel GARCH model from the link below
https://estima.com/forum/viewtopic.php?f=11&t=715

And I tried to adjust it according to the inputs I'm using by typing the following code

Code: Select all

all 13981
open data Threshold.xls
data(format=xls,org=columns) / index TSD TOD TND
*
set Xindex = 100.0*log(index/index{1})
*
* Estimation using MAXIMIZE
* The initial few lines of this set the estimation range, which needs to
* be done explicitly, and the number of variables. Then, vectors for the
* dependent variables, residuals and residuals formulas are set up. The
* SET instructions copy the dependent variables over into the slots in
* the vector of series.
*
compute gstart=2,gend=13981
compute n=4
dec vect[series] y(n) u(n)
dec vect[frml] resid(n)
set y(1) = Xindex
set DUMMY1 = TSD
set DUMMY2 = TOD
set DUMMY3 = TND 
* This is specific to a mean-only model. It sets up the formulas (the &i
* are needed in the formula definitions when the FRML is defined in a
* loop), and estimates them using NLSYSTEM. This both initializes the
* mean parameters, and computes the unconditional covariance matrix. If
* you want more general mean equations, the simplest way to do that
* would be to define each FRML separately.
*
dec vect b(n)
nonlin(parmset=meanparms) b
do i=1,n
   frml resid(i) = (y(&i)-b(&i))
end do i
nlsystem(parmset=meanparms,resids=u) gstart gend resid
compute rr=%sigma
*
* The paths of the covariance matrices and uu' are saved in the
* SERIES[SYMM] names H and UU. UX and HX are used to pull in residuals
* and H matrices.
*
declare series[symm] h uu
*
* ux is used when extracting a u vector
*
declare symm hx(n,n)
declare vect ux(n)
*
* These are used to initialize pre-sample variances.
*
gset h  * gend = rr
gset uu * gend = rr
*
* This is a standard (normal) log likelihood formula for any
* multivariate GARCH model. The difference among these will be in the
* definitions of HF and RESID. The function %XT pulls information out of
* a matrix of SERIES.
*
declare frml[symm] hf
*
frml logl = $
    hx = hf(t) , $
    %do(i,1,n,u(i)=resid(i)) , $
    ux = %xt(u,t), $
    h(t)=hx, uu(t)=%outerxx(ux), $
    %logdensity(hx,ux)
*****************************************************
*
* Panel GARCH - DVECH with restrictions
*
dec symm vcs(n,n)
dec real delta lambda gamma rho
dec symm vbs(n,n) vas(n,n)
*
compute vcs=rr*.1,delta=lambda=.8,gamma=rho=.1
nonlin(parmset=garchparms) vcs delta lambda gamma rho
frml hf = vcs+vbs.*h{1}+vas.*uu{1}
*
* Call once during START option to fill in the VAS and VBS arrays
*
function PGARCHInit
local integer i j
ewise vbs(i,j)=%if(i==j,delta,lambda)
ewise vas(i,j)=%if(i==j,gamma,rho)
end
*
maximize(start=PGARCHInit(),parmset=meanparms+garchparms,pmethod=simplex,piters=10,method=bfgs,iters=400) logl gstart gend
I tried many times and still don't know how to introduce dummy variables in the equations of the mean and conditional variance.

Thanks in advance
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Panel GARCH with dummy variable

Unread post by TomDoan »

Don't look at the program first. Figure out how you plan to adjust the specification of the model to handle the dummies. The panel GARCH model isn't modeling just variances, but is modeling the entire covariance matrix.
Ameer
Posts: 3
Joined: Sun Nov 11, 2018 12:22 pm

Re: Panel GARCH with dummy variable

Unread post by Ameer »

Dear Tom

My purpose is to combine the panel GARCH model with a set of dummy variables, so the model specification can be written as follows:

Image

where yit is a panel of weekly stock indices of 15 countries, μi captures possible country-specific effects, D is a vector of the dummy variables TSD, TOD and TND, β is a vector of coefficients, and uit is a disturbance term.

Then the likelihood function of the fixed-effects panel model with the time-varying conditional covariance is maximized by following the procedures applied in Cermeño and Grier (2006) and Lee (2010)

Image

Note that unlike Cermeño and Grier (2006) and Lee (2010), I'm not including any explanatory variable, because my purpose is to only check for significant changes in the mean and conditional variance over the periods specified with time-based dummy variables.

Here are the links of the papers I've been following
https://www.sciencedirect.com/science/a ... 650900370X
https://www.emeraldinsight.com/doi/book ... 2006%29274
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Panel GARCH with dummy variable

Unread post by TomDoan »

I think you're confused about what the model is doing. First, you do have explanatory variables---they're the dummies. And they are shifting the mean, not the variance. The model that you've described will not let you check whether "the conditional variance of stock prices have significant changes during these periods or not".
Ameer
Posts: 3
Joined: Sun Nov 11, 2018 12:22 pm

Re: Panel GARCH with dummy variable

Unread post by Ameer »

Dear Tom

Combining GARCH models with dummy variable is quiet common in the literature of finance, here's an example from an article using EGARCH model with dummy variables to test for the changes in the mean and conditional variance over specific periods

Image

The difference is that I'm using Panel GARCH instead of EGARCH, and since I have cross countries time series data on stock price, I thought that Panel GARCH model would fit well in this case, so is it possible to use Panel GARCH model in this case?

Before using Panel GARCH, I've done some tests on the variance of stock prices of each country individually, I've found that change points in the variance of stock prices vary according to the state of capital inflows, my assumption is based on these initial results. In addition, the papers I referred to are using panel GARCH model for the same purpose but without dummy variables. I contacted one of the authors of these papers and he suggested to me to use Panel GARCH model.
Last edited by Ameer on Wed Dec 26, 2018 6:42 pm, edited 2 times in total.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Panel GARCH with dummy variable

Unread post by TomDoan »

I understand how dummies are used in GARCH models. A panel GARCH model isn't what you want---a panel GARCH model is designed to let you apply panel-type models (such as fixed effects) to the mean while allowing for a GARCH error process. The GARCH process itself is (in effect) a "nuisance" to the estimation of the mean model and not of any great interest on its own. A multivariate CC EGARCH model would probably be a better choice---with just four dependent variables, you wouldn't have an overparameterized model.
Post Reply