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,