How to get the OLS estimate from a regression based on a vector?

I have a vector y of dimension nx1. I want to get the OLS estimate of the regression of Δy on y_t-1 (t=1,2...n). How can I do it?

Respuestas (1)

Jeff Miller
Jeff Miller el 11 de Sept. de 2019
Editada: Jeff Miller el 11 de Sept. de 2019
How about this:
deltay = diff(y);
b = regress(deltay,y(1:end-1));

Categorías

Más información sobre Linear and Nonlinear Regression en Centro de ayuda y File Exchange.

Preguntada:

el 11 de Sept. de 2019

Editada:

el 11 de Sept. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by