ANFIS: Out-of-sample forecasting

1 view (last 30 days)
pavlos
pavlos on 15 Feb 2017
Hello,
Please help me with the following:
Consider a TrainInput matrix
A=
[6445.63 6341.97
6554.53 6445.63
6697.14 6554.53
6867.47 6697.14 ];
Consider a TrainOutput matrix
B=
[6554.53
6697.14
6867.47
6965.699
6986.04];
During training, the TrainOutput becomes TrainInput when moving tho the next sample.
For instance,
TrainOutput(1)= 6554.53;
becomes
TrainInput(2,1) in order to forecast TrainOutput(2).
When reaching at the end of TrainInput matrix, I need to forecast the next 10 sample using as training samples the ANFIS outputs (there is no available TestInput).
I`ve tried using the following code:
fis = anfis([TrainInputs,TrainTargets]);
TrainOutputs=evalfis(TrainInputs,fis);
for i=1:10
TrainOutputs(4+i)=evalfis([TrainInputs(4+i);[TrainOutputs(end),TrainInputs(end,1)]],fis);
end
but it does not work.
Thank you.
Best,
Pavlos

Answers (0)

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!