Page 1 of 1

SWARCH

Posted: Wed Aug 24, 2016 9:09 am
by Fragui
Hello,

I am investigating the effect of a number of macroeconomic indicators on the volatility of stock market returns.

I would like to use a SWARCH model and wonder if you could clarify the following:
1) is it possible to use the SWARCH command and options to add the some macroeconomics regressors (the manual only shows the case of a simple ARCH model, without any independent variable regressors)
2) would it be possible to estimate a Time varying probability model? If so which command and examples would you recommend I should use?
3) would it be possible to include lagged dependent/independent variables?

Thank you for your assistance,

Re: SWARCH

Posted: Wed Aug 24, 2016 12:32 pm
by TomDoan
Fragui wrote:Hello,

I am investigating the effect of a number of macroeconomic indicators on the volatility of stock market returns.

I would like to use a SWARCH model and wonder if you could clarify the following:
The first question is why a SWARCH model? In a SWARCH, the volatility is affected by an exogenous unobservable process. If you're trying to investigate the effect of observable indicators on volatility, wouldn't some form of GARCH-X model be appropriate?
Fragui wrote: 1) is it possible to use the SWARCH command and options to add the some macroeconomics regressors (the manual only shows the case of a simple ARCH model, without any independent variable regressors)
To what? The variance? The mean? The Hamilton-Susmel examples (which use a somewhat different version of SWARCH) include a lagged dependent variable in the mean. As long as the mean model coefficients don't switch, it's a relatively straightforward extension. If they do switch (which is probably not a good idea), then it's quite a bit more complicated.
Fragui wrote: 2) would it be possible to estimate a Time varying probability model? If so which command and examples would you recommend I should use?
Yes. The Filardo example has that. However, I wouldn't play with that until you get the simpler model to work.
Fragui wrote: 3) would it be possible to include lagged dependent/independent variables?
Isn't that the same as question #1?

Re: SWARCH

Posted: Sat Aug 27, 2016 12:20 pm
by Fragui
Dear Tom,
Many thanks for your prompt reply.
The main purpose of our analysis is to investigate volatility properties in the returns of a time series representing a portfolio made up of the U.S, and Emerging stock markets (EQWP_returns)
We would like to examine whether volatility of the EQWP_returns series changed over time by using ARCH and GARCH models as you suggested. Our conditional mean equation contains also some macro-economic indicators.

However we are interested in studying whether there are different states of volatility in our dependent variable time series. This is because we would like to account for breaks such as the financial crisis and policy responses such as waves of quantitative easing purchases. To do so we want to apply the SWARCH model because this model can help us to analyse different states of volatility and estimate probability of changes in these states.

We used the SWARCH commands below but we have not been able to include regressors other than the constant. Our questions are:

1) Is it possible by adapting the command:

nonlin(parmset=meanparms) mu

to add additional regressors to the SWARCH model below?

2) Would it be possible to estimate it using time varying prob?

-----------------------------------------------------------------------------------------------------
OUR SWARCH MODEL:

Code: Select all

open data " C:\Users\cm55\Desktop\Copy of DatasetUSFM_News_v6"
CALENDAR(WEEKLY) 2003 01 10
ALL 2014:9:26
data(format=xlsx,org=columns) 2003:01:10 2014:9:26
table


smpl 2003:01:10 2014:09:26
*set delta_EURO_DOLLAR = 100.0*log(EURO_DOLLAR/EURO_DOLLAR{1})
*set delta_YEN_DOLLAR = 100.0*log(YEN_DOLLAR/YEN_DOLLAR{1})
*set delta_STERLING_DOLLAR = 100.0*log(STERLING_DOLLAR/STERLING_DOLLAR{1})
*set delta_QE = 100*log(QE_USA/QE_USA{1})
set EQWP_PERC = 100* EQWP_RETURN

@MSSetup(states=2)
compute q=2

dec vect hv(nstates-1)
*
dec vect a(q)
*

nonlin(parmset=meanparms) mu
nonlin(parmset=archparms) a0 a hv
nonlin(parmset=msparms)   theta
clear uu u
*

function ARCHStateF time e
type vector  	ARCHStateF
type real 	 	e
type integer 	time
*
local integer 	i j
local real 		vi
*
dim ARCHStateF(nstates)
do i=1,nstates
   compute vi=a0*%if(i>1,hv(i-1),1)
   do j=1,q
      compute vi=vi+a(j)*uu(time-j)
   end do i
   compute ARCHStateF(i)=%if(vi>0,%density(e/sqrt(vi))/sqrt(vi),0.0)
end do i
end
*
*
compute p=||.7,.15|.3,.4||
compute theta=%msplogistic(p)
*
stats EQWP_return
compute mu=%mean,a0=%variance,a=%const(0.05)
set uu = %variance
*
frml logl = u(t)=(EQWP_return-mu),uu(t)=u(t)^2,$
   f=ARCHStateF(t,u(t)),fpt=%MSProb(t,f),log(fpt)
*
@MSFilterInit
*
*
nonlin(parmset=pegs) theta(1,2)=-5.00
maximize(start=%(p=%mslogisticp(theta),pstar=%msinit()),$
 parmset=meanparms+archparms+msparms+pegs,$
 method=bhhh,iters=800,pmethod=simplex,piters=10) logl 2 *

@MSSmoothed %regstart() %regend() psmooth
set p1 = psmooth(t)(1)
set p2 = psmooth(t)(2)
*set p3 = psmooth(t)(3)
spgraph(vfields=2,samesize)
graph(style=stacked,maximum=1.0,picture="##.##",$
  header="Smoothed Probabilities of Variance States",$
  key=none,klabels=||"Low Variance","High Variance"||) 2
# p1 400 500
# p2 400 500
*# p3 400 500
graph(picture="##.##",header="Data")
# EQWP_return 400 500
spgraph(done)

OUR RESULTS FIRST ATTEMPT (we wanted to check if it worked)

Code: Select all

Statistics on Series EQWP_RETURN
Weekly Data From 2003:01:10 To 2014:09:26
Observations                 612
Sample Mean             0.001375      Variance              0.000353
Standard Error          0.018787      SE of Sample Mean     0.000759
t-Statistic (Mean=0)    1.810490      Signif Level (Mean=0) 0.070711
Skewness               -2.048135      Signif Level (Sk=0)   0.000000
Kurtosis (excess)      15.319516      Signif Level (Ku=0)   0.000000
Jarque-Bera          6412.407999      Signif Level (JB=0)   0.000000


MAXIMIZE - Estimation by BHHH
Convergence in    24 Iterations. Final criterion was  0.0000084 <=  0.0000100
Weekly Data From 2003:01:24 To 2014:09:26
Usable Observations                       610
Function Value                      1688.2146

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  MU                            0.002942881  0.000552599      5.32552  0.00000010
2.  A0                            0.001166521  0.000181323      6.43339  0.00000000
3.  A(1)                          0.099062294  0.051683699      1.91670  0.05527569
4.  A(2)                          0.043328321  0.044628873      0.97086  0.33161875
5.  HV(1)                         0.113896522  0.017337040      6.56955  0.00000000
6.  THETA(1,1)                    2.995533934  0.482968506      6.20234  0.00000000
7.  THETA(1,2)                   -5.000000000  0.000000000      0.00000  0.00000000
Thank you for your help,

Re: SWARCH

Posted: Sat Aug 27, 2016 2:05 pm
by TomDoan
You're copying over things from the SWARCH.RPF that may not make sense. Why are you pegging the (1,2) transition parameter? The (1,3) transition in the original work needed to be pegged to zero probability, but I seriously doubt that you need it here. The graphs in the original program run over a short range (observations 400-500) because it has 6000+ observations and a full graphs just smears together. You have about 1/10 as many.

I already mentioned that the Hamilton-Susmel replications include a more complicated mean model. You should probably look at that. It's also probably not clear a prior whether the Hamilton-Susmel form for SWARCH or the Cai form is better anyway.

Yes. Again, as I said above, the Filardo method for handling switch probabilities as logistic indexes would apply here as well.