Additive outlier detection
Additive outlier detection
Hi,
has anyone any experience of identifying additive outliers in particular the method of Franses and Ghijsels (1999)?
Thank you.
has anyone any experience of identifying additive outliers in particular the method of Franses and Ghijsels (1999)?
Thank you.
Re: Additive outlier detection
The following will find the largest LM statistic for an additive outlier in a simple GARCH model with the mean model being just the mean and any previously detected outliers (or any other shifts).
The following is an example using the data set from the GARCHUV.PRG example.
The process gets a bit trickier if the mean model is an AR(1) (for instance). The additive outlier needs to adjust the mean of process, not the intercept in the mean equation, that is, the mean model needs to take the form
(y(t)-mu(t))=a*(y(t-1)-mu(t-1))+eps(t)
where mu is a linear function. GARCH(REG) won't estimate a model in that form. (It wants the linear form y(t)=intercept(t)+a*y(t-1)+eps(t)).
Code: Select all
procedure GARCHOutlier y start end previous
type vect[series] *previous
*
local vect[series] dd
local series h eps dh deps grad
local integer test gstart gend
*
garch(p=1,q=1,reg,hseries=h,resids=eps,derives=dd) start end y
# constant previous
compute gstart=%regstart(),gend=%regend()
set lmstat gstart gend = 0.0
do test=gstart,gend
set deps gstart gend = (t==test)
set(first=0.0) dh gstart gend = %beta(%nreg)*dh{1}+%beta(%nreg-1)*eps{1}*deps{1}
set grad gstart gend = -.5*dh/h+.5*(eps/h)^2*dh-(eps/h)*deps
cmom(zxmatrix=xu)
# dd
# grad
compute lmstat(test)=%qform(%xx,xu)
end do test
ext(print) lmstat gstart gend
endCode: Select all
open data garch.asc
all 1867
data(format=free,org=columns) / bp cd dm jy sf
set dlogdm = 100*log(dm/dm{1})
dec vect[series] outliers(0)
@GARCHOutlier dlogdm / outliers
dim outliers(1)
set outliers(1) = (t==1448)
@GARCHOutlier dlogdm / outliers(y(t)-mu(t))=a*(y(t-1)-mu(t-1))+eps(t)
where mu is a linear function. GARCH(REG) won't estimate a model in that form. (It wants the linear form y(t)=intercept(t)+a*y(t-1)+eps(t)).
Last edited by TomDoan on Tue Jan 27, 2009 4:31 pm, edited 1 time in total.
Re: Additive outlier detection
Thanks for the reply. But I've been trying to run the program but keep getting an error:
## SX22. Expected Type INTEGER, Got VECTOR(SERIES) Instead
>>>>er dlogdm outliers<<<<
Any ideas what I should do next?
## SX22. Expected Type INTEGER, Got VECTOR(SERIES) Instead
>>>>er dlogdm outliers<<<<
Any ideas what I should do next?
Re: Additive outlier detection
I corrected the example (second code segment) above. It was missing a / between dlogdm and outliers.