How to save residuals of a mutilivariate estimation

Questions and discussions on Vector Autoregressions
g_defi
Posts: 12
Joined: Fri Nov 19, 2010 8:42 am

How to save residuals of a mutilivariate estimation

Unread post by g_defi »

Dear Tom,

I estimate a bivariate VARFIMA using the gaussian semi-parametric estimator of Shimotsu (2007, Journal of Econometrics). The source code I use is reported below.
Is there a convenient method to save the vector of residuals from a multivariate estimation that use the maximize instruction (a multivariate version of %resids)?

Thanks for you help.

Code: Select all

********
*Gaussian semiparametric estimation of multivariate fractionally integrated processes
*K. Shimotsu (2007), Journal of Econometrics, No 137
*(Valid for covariance stationary processes... 
*...See, F. Nielsen (2011), JTSA, No 32, for an extension to non-stationary processes)
********

procedure mWnb y x start end
type series y x
type integer start end

option real bandwidth
option switch 	print 	1
option vect idelta		||0.4,0.2||

local vect delta
local symm sigma
local real wei
local int n
local int m

local cseries ftcy ftcx
local series pyy pxx pyx pxy
local cseries csyy csxx csyx csxy

local frml[rect] ilam
local frml[symm] iper itrf
local frml[complex] ipyy ipxx ipyx

***************************** Init
comp n = end - start + 1
stat(noprint) y start end
set y start end = y - %mean
stat(noprint) x start end
set x start end = x - %mean

dim sigma(2,2) delta(2)
comp delta = idelta, sigma = %identity(2)

if %defined(bandwidth)
{
	comp m = fix(n^bandwidth)
}
else
{
	comp m = fix(n^0.8)
}

frequency 3 m

***************************** Spectral analysis

*************************************************************************************
**** (La commande RtoC semble bugger lorsque l'option est sur pad et que la série
**** de sortie est renommée. Solution: utiliser une référence numérique en sortie)
*************************************************************************************
rtoc(pad) start end
# y
# 1
fft 1 / ftcy

rtoc(pad) start end
# x
# 2
fft 2 / ftcx

comp wei = 1.0/sqrt(2*%pi*float(n))

cmul(scale=wei) ftcy ftcy / csyy
cmul(scale=wei) ftcx ftcx / csxx
cmul(scale=wei) ftcy ftcx / csyx
cmul(scale=wei) ftcx ftcy / csxy

     	nonlin(parmset=fi) delta
     	nonlin(parmset=sd) sigma

     	frml ipxx = csxx
     	frml ipyy = csyy
     	frml ipyx = csyx
		frml iper = ||%real(ipyy)|%real(ipyx),%real(ipxx)||

     	frml ilam = %diag(||%cabs((1.0-%zlag(t,1))^delta(1))|%cabs((1.0-%zlag(t,1)))^delta(2)||)
     	frml itrf = %ginv(ilam)*sigma*tr(%ginv(ilam))

     	frml logl = %logdensitycv(itrf,iper,(float(n)/m))

     	maximize(parmset=fi+sd,method=bfgs,iter=150,pmethod=simplex,piters=5, $
     	print=print,title="Local Whittle Approx. of Fractionally Integrated processes") logl 1 m


comp %dvec = delta, %G = sigma

end procedure
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to save residuals of a mutilivariate estimation

Unread post by TomDoan »

I'm not sure there are well-defined residuals for that type of estimator. Whittle estimators don't create residuals as part of the calculation. For a univariate model, you can back the implied residuals out from the periodogram and estimated spectral density, but when it's multivariate, there are an infinite number of factors of the spectral density that could be used to reverse out the residuals.
g_defi
Posts: 12
Joined: Fri Nov 19, 2010 8:42 am

Re: How to save residuals of a mutilivariate estimation

Unread post by g_defi »

Thank you very much for your reply and your explanation.

I try to save residuals to implement a test for equality of integration orders (e.g. Hualde 2012, A simple test for equality of integration orders, working paper).
Is there a similar test, among RATS procedures, which have escaped my attention?

Thanks for your help.
Post Reply