Let's say I have the following model:

enter image description here

So I have an AR model of order 3, and I want to estimate A1, A2, and A3.

I understand how regression normally works for two variables x and y. Also, after doing some research, I think I've figured out to implement a regression for an AR(1) model. But I'm having problems extending this to AR(p). Can someone give an example of how this is done for my case? There dont seem to be any built in functions for MATLAB either. Or, am I not supposed to use regression for this type of problem? I'd appreciate any help.


If you want to implement an AR(3) model you can proceed like this: Let A be your $(Nx1)$ vector. Simply define your dependent variable $Y$ and your matrix of explanatory variables $X$ as follows:

Y = A(4:end,1);
X = [A(3:end-1,1), A(2:end-2,1), A(1:end-3,1)]

then simply run an OLS function (from the Kevin Sheppard Toolbox for ex.)

[beta, tstat] = ols(Y,X,1);

If I understand you equation correctly, you want to use one lag to predict the returns for the 10th period. In that case simply adjust the equation above to select the lags that fit your purpose. Note that you want to have the same dimensions in $Y$ and $X$.

  • $\begingroup$ Makes sense, and thanks for pointing out the toolbox. $\endgroup$ – John Alperto Apr 22 '16 at 1:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.