Problem with vector autoregressive model (vgxvarx) - "Covariance is not positive-definite."
Mostrar comentarios más antiguos
Hi.
I have a dataset of 27 different variables measured during the same time period with the same lengths that I am trying to create a vector autoregressive model of using the method shown in the webinar “ Long Term Energy Forecasting with Econometrics in MATLAB ” which is basically:
Y=data; %10000x27 matrix of data
nAR = 12; % Define number of lags
Spec = vgxset('n', numel(YSeries), 'Constant', true, 'nAR', nAR, 'Series', YSeries);
Spec = vgxvarx(Spec, Y);
If I try running this with only two of the vectors Y(:,1:2) it works but the model obviously isn’t very good. When I start introducing more vectors to the model for example Y(:,1:10) I always get the error:
Error using mvregress (line 452)
Covariance is not positive-definite.
And I am unable to build the model.
What am I doing wrong here? In the webinar example he has many input vectors and the code never complains...
Thanks.
Respuesta aceptada
Más respuestas (1)
Maisa Melo
el 28 de Ag. de 2018
0 votos
Hi Peta,
I need implement a code using vgxvarx at Matlab, but I'm not know exacly how is the input data. I'm trying reproduce your code, but in your code there is no the valur of YSeries. I would like know your YSeries for I reproduce your code.
Best regard.
Maisa
Categorías
Más información sobre Chemistry en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!