Matlab estimation of an AR(1) process

Hi everyone!
As a start-up for a coming thesis dealing with non-linear time series estimation I am right now trying to estimate the parameters of an AR(1) model in Matlab. I know that there is a built in command to do this, but as I want to understand the process better I am typing my own script.
The estimation is done with maximum likelihood (ML), using the following equation:
l= (-1/2) * log(2*pi) - (1/2) * log(sigma2)^2 - ... ((y(t)-a0-a1*y(t-1))./(2*sigma2))
y(t) is the data given as input (a 250x1 vector) and the parameters a0, a1 and sigma2 are to be estimated. In theory this is done by maximizing the expression above, w.r.t a0, a1 and sigma2. My question then, after this rather tedious introduction of my problem, is how I am going to be able to maximize this given that y(t) is a vector. Since both y(t) and y(t-1) are part of the vector l will become a vector - but how am able to solve for the maximum values of a0, a1 and sigma2 when I have a function (l) with a vector (y) as inputs?
Any help will be greatly appreciated!
Best regards,
Eric

Answers (0)

Categories

Asked:

on 26 Jun 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!