Can MATLAB ANFIS handle multiple outputs (n responses) from two inputs in a single model, or must separate ANFIS models be built for each output?
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have an experimental dataset with two input variables and multiple dependent output responses (n outputs). Using MATLAB’s ANFIS framework, is it possible to develop a single ANFIS model capable of predicting all output responses simultaneously, or does ANFIS require building separate models for each output variable?
0 Commenti
Risposte (1)
Sam Chak
34 minuti fa
Hi @Girinath
Fuzzy systems can handle multiple‑input multiple‑output (MIMO) processes, provided the then‑side outputs share the same premises (input membership functions) on the if‑side and use the same fuzzy rules. However, the ANFIS training algorithm, anfis(), can generate only a single‑output Sugeno fuzzy system by tuning membership‑function parameters on both sides and adjusting the fuzzy‑rule structure.
If a single MIMO Sugeno fuzzy system is strictly required to be trained within the ANFIS framework, first create an initial fuzzy system for each output from the training dataset using genfis(), then mark all input‑MF parameters and existing rules (preferably grid‑partition format) as non‑tunable so that only the output‑function parameters (typically linear) are tuned. Because the individually trained fuzzy systems share the same input MFs and rules, you can manually merge them into a single MIMO Sugeno system. Depending on the original outputs’ characteristics, this approach often produces limited accuracy and typically produces a substantially higher root‑mean‑squared validation error than independently trained, unconstrained Sugeno systems.
Alternatively, you can use tunefis() to train a MIMO Sugeno Fuzzy Tree with the "anfis" setting.
fis = sugfis;
c = 1.5;
cross = 1/3; % intersection of adjacent MFs
sigma = 0.5*(2*c)/sqrt(-2*log(cross)); % standard deviation of each Gaussian MF
% Fuzzy Input 1
fis = addInput(fis, [-2*c +2*c], 'Name', 'x1');
fis = addMF(fis, 'x1', 'gaussmf', [sigma -3], 'Name', 'N');
fis = addMF(fis, 'x1', 'gaussmf', [sigma 0], 'Name', 'Z');
fis = addMF(fis, 'x1', 'gaussmf', [sigma +3], 'Name', 'P');
% Fuzzy Input 2
fis = addInput(fis, [-2*c +2*c], 'Name', 'x2');
fis = addMF(fis, 'x2', 'gaussmf', [sigma -3], 'Name', 'N');
fis = addMF(fis, 'x2', 'gaussmf', [sigma 0], 'Name', 'Z');
fis = addMF(fis, 'x2', 'gaussmf', [sigma +3], 'Name', 'P');
% Fuzzy Output
fis = addOutput(fis, [-1 +1], 'Name', 'y1');
fis = addMF(fis, 'y1', 'constant', -1.0, 'Name', 'ou1');
fis = addMF(fis, 'y1', 'constant', -0.5, 'Name', 'ou2');
fis = addMF(fis, 'y1', 'constant', 0.0, 'Name', 'ou3');
fis = addMF(fis, 'y1', 'constant', 0.5, 'Name', 'ou4');
fis = addMF(fis, 'y1', 'constant', 1.0, 'Name', 'ou5');
fis = addOutput(fis, [ 0 +1], 'Name', 'y2');
fis = addMF(fis, 'y2', 'constant', 0.0, 'Name', 'ouZ');
fis = addMF(fis, 'y2', 'constant', 1.0/0.952388, 'Name', 'ouP');
% Fuzzy Rules
rules = [
"x1==N & x2==N => y1=ou1, y2=ouZ"
"x1==N & x2==Z => y1=ou2, y2=ouZ"
"x1==N & x2==P => y1=ou3, y2=ouZ"
"x1==Z & x2==N => y1=ou2, y2=ouZ"
"x1==Z & x2==Z => y1=ou3, y2=ouP"
"x1==Z & x2==P => y1=ou4, y2=ouZ"
"x1==P & x2==N => y1=ou3, y2=ouZ"
"x1==P & x2==Z => y1=ou4, y2=ouZ"
"x1==P & x2==P => y1=ou5, y2=ouZ"
];
fis = addRule(fis, rules);
figure(1)
subplot(211)
plotmf(fis, 'input', 1, 2001), grid on,
xlabel('x1')
title('input 1 MFs')
subplot(212)
plotmf(fis, 'input', 2, 2001), grid on,
xlabel('x2')
title('input 2 MFs')
% Fuzzy surfaces
figure(2)
gensurf(fis, gensurfOptions('OutputIndex', 1, 'NumGridPoints', 51));
xlim([-3, 3])
ylim([-3, 3])
xlabel('x_{1}'), ylabel('x_{2}'), zlabel('y_{1}'), title ('Output 1 surface')
figure(3)
gensurf(fis, gensurfOptions('OutputIndex', 2, 'NumGridPoints', 51));
xlim([-3, 3])
ylim([-3, 3])
xlabel('x_{1}'), ylabel('x_{2}'), zlabel('y_{2}'), title ('Output 2 surface')
% Plot rules
figure(4)
plotrule(fis)
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



