How can I estimate a Vector Autoregressive (VAR) Model by OLS?

13 visualizaciones (últimos 30 días)
Valentina
Valentina el 17 de Oct. de 2013
Comentada: Spyridon Kariofylis el 10 de Jul. de 2020
How can I estimate a VAR Model with the vgxvarx function by Ordinary Least Squares ( OLS )?
By default vgxvarx uses the Maximum Likelihood and I can't find how to change it.
I tried with the default MLE:
Spec = vgxset('n',5,'nAR',1,'Constant',false);
EstSpec = vgxvarx(Spec, Y, [], Y0);
but I get this error:
Error using mvregress (line 425)
Covariance is not positive-definite.
Error in vgxvarx (line 521)
[x,Q,~,xvar] = mvregress(D,R, 'covtype',covartype, 'varformat',varformat, ...
Here:
it mentions to set 'MaxIter' to 1 for OLS, but it's not clear how to use the OLS approach.
  2 comentarios
Shashank Prasanna
Shashank Prasanna el 17 de Oct. de 2013
Would you be willing to share why you don't want to use the MLE approach in the Econometrics toolbox?
Valentina
Valentina el 17 de Oct. de 2013
Editada: Valentina el 18 de Oct. de 2013
Because with MLE I get the above-mentioned error, while I was able to estimate the model with the same data, using a function in the R software that uses OLS.

Iniciar sesión para comentar.

Respuestas (1)

Hang Qian
Hang Qian el 30 de Mzo. de 2014
Editada: Hang Qian el 30 de Mzo. de 2014
Yes, estimation of a VAR(p) model by OLS is possible using the vgxvarx functionality. The vgxvarx uses maximum likelihood for rigorous treatment of missing values and presample values.
If the data are complete and presample values are specified (using the first p values of the data), vgxvarx will produce an estimator identical to the OLS estimator. For example, consider a VAR(2) model with 3 variables,
Y = rand(100,3);
Spec = vgxset('n',3,'nAR',2);
EstSpec = vgxvarx(Spec,Y(3:100,:),[],Y(1:2,:));
OLS1 = [EstSpec.AR{1},EstSpec.AR{2}]'
OLS2 = [Y(2:end-1,:),Y(1:end-2,:)] \ Y(3:end,:)
The second estimator is the raw OLS estimator.
norm(OLS1-OLS2) suggests that vgxvarx reproduces the raw OLS estimator.
Hang Qian

Categorías

Más información sobre Conditional Mean Models en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by