s =xlsread('ARIMA_data.xls');
l_s = length(s);
lag=15;
l=l_s;
cA=zeros(l_s/2,10);
cD=zeros(l_s/2,10,10);
D=zeros(l_s,10,10);
A=zeros(l_s,10);
for i=1:10
clear input
[C,L] = wavedec(s,i,'db5');
ca=appcoef(C,L,'db5',i);
pp=size(ca);
cA(1:pp(1,1),i)=ca;
clear ca;
clear pp;
A(:,i)= wrcoef('a',C,L,'db5',i);
for j=1:i
cd=detcoef(C,L,j);
qq=size(cd);
cD(1:qq(1,1),i,j)= cd;
clear cd;
clear qq;
D(:,i,j) = wrcoef('d',C,L,'db5',j);
input(:,j)= D(:,i,j);
end
input(:,j+1)=A(:,i);
ii=size(input);
input=input(1:(ii(1,1)-lag-1),:);
clear ii;
input=input';
t=s(2+lag:l_s);
t=t';
for h=1:15
for trial=1:5
net = feedforwardnet(h,'trainlm');
net.divideFcn = 'divideblock';
net.inputs{1}.processFcns = {'removeconstantrows'};
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 5/100;
net.divideParam.testRatio = 25/100;
net.layers{1}.transferFcn = 'tansig';
net.layers{2}.transferFcn = 'purelin';
net.performFcn = 'mse';
net.trainParam.showWindow = 0;
[tNet,tr] = train(net,input,t);
output = tNet(input);
test_t = t(tr.testInd);
test_output = output(tr.testInd);
net.performFcn = 'mse';
perf=perform(tNet,test_t,test_output);
perfR=corrcoef(test_t,test_output);
arc(h,trial,i)=perf;
arcR(h,trial,i)=perfR(1,2);
end
end
clear input
end
Subscripted assignment dimension mismatch.
Error in WNN_RGMatlab (line 24)
A(:,i)= wrcoef('a',C,L,'db5',i);