logmvskew
Posted: Wed Mar 21, 2012 4:11 am
Dear all,
I am facing problems trying to use %logmvskewt and i had read the article by Luc Bauwens and Sebastien Laurent for many times and tried numerous ways to solve it for many days but still failed. Can anyone guide me as to how I can solve it? i always get this command,"## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points". I tried changing the dates to gstart+1 or 2 or even 20 but to no avail. something must be wrong with the z value which is y-mean/st.deviation whihc is tried to decipher using set testlog start end = logl(t). There are only NAs....Thanks a lot.
I am facing problems trying to use %logmvskewt and i had read the article by Luc Bauwens and Sebastien Laurent for many times and tried numerous ways to solve it for many days but still failed. Can anyone guide me as to how I can solve it? i always get this command,"## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points". I tried changing the dates to gstart+1 or 2 or even 20 but to no avail. something must be wrong with the z value which is y-mean/st.deviation whihc is tried to decipher using set testlog start end = logl(t). There are only NAs....Thanks a lot.
Code: Select all
*
* GARCHMVMAX.RPF
* RATS Version 8, User's Guide, Example from Section 9.9
*
open data g10xrate.xls
data(format=xls,org=columns) 1 6237 usxjpn usxfra usxsui
*
set xjpn = 100.0*log(usxjpn/usxjpn{1})
set xfra = 100.0*log(usxfra/usxfra{1})
set xsui = 100.0*log(usxsui/usxsui{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=6237
compute n=3
dec vect[series] y(n) u(n) z(n)
dec vect[frml] resid(n)
set y(1) = xjpn
set y(2) = xfra
set y(3) = xsui
*
* 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
*
source logmvskewt.src
dec vector xi(2)
nonlin(parmset=distparms) nu xi
compute nu=10.0, xi=||0.01,0.01||
*
do i=1,n
set z(i) * gend = u(i)/sqrt((h(t)(i,i)))
end do i
frml logl = $
hx = hf(t) , $
%do(i,1,n,u(i)=resid(i)) , $
ux = %xt(z,t), $
h(t)=hx, uu(t)=%outerxx(ux), $
%logmvskewt(ux,xi,nu)
*****************************************************
*
* Standard GARCH(1,1)
*
dec symm vcs(n,n) vas(n,n) vbs(n,n)
compute vcs=rr,vbs=%const(0.80),vas=%const(0.05)
nonlin(parmset=garchparms) vcs vas vbs
nonlin(parmset=distparms) nu xi
frml hf = vcs+vbs.*h{1}+vas.*uu{1}
maximize(parmset=meanparms+garchparms+distparms,pmethod=simplex,piters=10,$
iters=400) logl gstart+1 gend