If this is the case, how we can add the moving window? Supposing that the lag is equal to 3, for example:
N= lenght(data);d=timestep ahead;input = data( 1:N-d); % No transpose;
target = data( 1+d : N );MSE00 = var(target',1) % Reference MSE
net = fitnet; % default H = 10
net.divideParam.valRatio = 10/100;net.divideParam.testRatio = 20/100;[net tr output error ] = train(net, input, target);%output = net(input);
error = target - output;NMSE = mse(error)/MSE00 % Range [ 0 1 ]
R2 = 1- NMSE
Thanks
Best Answer