There is no actual limitation to the number of dimensions "vgvarx" accepts.
You are getting this error because of the way you are calling the function "vgxvarx". According to the documentation, you can call this function in two ways:
1. With exactly two arguments, "Spec" and "Y". In your code, these are the variables "Mdl" and "EstY".
2. With four or more arguments, "Spec", "Y", "X", "Y0", and additional name/value pair arguments.
In your code, you use a mix of these two syntaxes, by providing variables "Mdl" and "EstY" and the name/value pair 'IgnoreMA', 'yes':
>> vgxvarx(Mdl, EstY, 'IgnoreMA','yes');
Using this syntax, the word 'yes' is interpreted as the argument "Y0", a vector of length 3 (because of the three characters in the word). That is why your code does not return an error when your data has 3 columns, but returns an error for any other number of columns. However, the results of the function will not be the ones you expect, even if your data indeed has 3 columns.
To work around this error, please use the following syntax instead:
>> vgxvarx(Mdl, EstY, [ ], [ ], 'IgnoreMA','yes');
This way, you are calling the function and setting "X" and "Y0" to the empty vector [ ], which enables you to then set the 'IgnoreMA' argument to 'yes'.
Please find the documentation page in question in the following link:
Best Answer