MATLAB: Please expalin the error

time series

Hi ,
for the data set y, I need to fit an ar model and calculate the best order using aic.
I used the following code to do that:
V = arxstruc(y,struc(1:15));
m = selstruc(V,'aic');
However, I got the following error when I tried to run it.
Error using struc (line 21)
Not enough input arguments.
Error in big100 (line 47)
V = arxstruc(y,struc(1:15));
Can someone correct this please?
Full code:
clc;
clear;
a0 = 0.05; a1 = 0.1; b1 = 0.85;
epsi=zeros(3000,1);
simsig=zeros(3000,1);
for i = 1:3000
if (i==1)
simsig(i) = a0 ;
s=(simsig(i))^0.5;
epsi(i) = normrnd(0,1) * s;
else
simsig(i) = a0+ a1*(epsi(i-1))^2+ b1*simsig(i-1);
s=(simsig(i))^0.5;
epsi(i) = normrnd(0,1) * s;
end
end
yt1=epsi.^2;
y = yt1(2001:3000);
V = arxstruc(y,struc(1:15));
m = selstruc(V,'aic');

Best Answer

The documentation for struc indicates that it takes three input arguments:
>>help struc
struc Generate typical structure matrices for ARXSTRUC and IVSTRUC.
NN = struc(NA,NB,NK)
NA, NB and NK are vectors containing the orders na, nb and delays nk
to be tested. See help on ARX for an explanation of na, nb and nk.
NN is returned as a matrix containing all possible combinations of these
orders and delays.
...
But you have called it with only one vector (1:15). You need to choose values for nb and nk to test as well.