Hi,
I am using nlminb to estimate
a parameter which is time varying and autocorrelated by
itself. Say, for example,
rho(t)=a0+alpha*rho(t-1)+beta*X(t-1)
Previously, rho is a fixed number, now I use the
formula above to let it change with time. This, a0, alpha and beta is the parameters which I want to estimate.
X(t) is a known time series vector.
What I program is to create a new vector rho, so I have
to initial the first value of vector rho
rho=NULL
rho[1]=0.2
for(i
in 2:(length(X)))
{
rho[i]=a0+alpha*rho[(i-1)]+beta*X[(i-1)]
}
Then I put rho back to my ML function. As we know, to create
a time varying vector using iteration is quite time consuming. Do you have some
idea how to make an autocorrelated vector without iteration?
Many thanks,
Chen Sichong
PhD of Finance
Manchester Business School
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL