How to estimate a VAR(k) model with diagonal autoregressive and covariance matrices using varm?

3 views (last 30 days)
I used to use vgxvarx with 'CovarType','Diagonal' to estimate a VAR model with diagonal autoregressive and covariance matrices in R2017a.
But vgxvarx is no longer used in a newer version, instead varm and estimate are used.
Here is my code:
----------------------------------
irow = 213; % number of series
dt = logical(eye(irow));
VAR1diag = vgxset('ARsolve',repmat({dt},1,1),'asolve',true(irow,1));
VARdiag = vgxset(VAR1diag,'nAR',k,'ARsolve',repmat({dt},K,1));
[EstSpec,EstStdErrors,LLF,W] = vgxvarx(VARdiag,Yest,[],Ypre,'CovarType','Diagonal');
My revised code with varm follows:
-----------------------------------
irow = 213; % number of series
dnan=diag(nan(irow,1));
VARdiag = varm('AR',repmat({dnan},1,k));
[EstSpec,EstStdErrors,LLF,W] = estimate(VARdiag,Yest,'Y0',Ypre);
When I run the revised code, MATLAB said, requested 363378x363378(983.8GB) array exceeds maximum array size preference...
I think there is a similar property option like 'CovarType','Diagonal', but can't find it.
If you know how to fix this issue, please let me know. I appreciate your help.
Thanks.

Answers (0)

Community Treasure Hunt

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

Start Hunting!