Does inverse modelling is possible with ANFIS?

4 views (last 30 days)
I have trained an ANFIS model with 2 inputs and 1 output. Now, I want to invert this model, i.e., use the output as input and obtain the original 2 inputs. How can I achieve this in MATLAB? Are there any specific functions or techniques I can use to invert an ANFIS model?

Accepted Answer

John D'Errico
John D'Errico on 23 Mar 2025
In general, absolutely no. This is impossible. Why do I say that? Consider even an absolutely trivial linear model. I don't need anything fancy here.
z = x + y
Suppose you estimate that model from some data. I've even been lazy, and given you a very simple result, of some hypotheocal model, with a very boring set of coefficients.
Now your goal will be, given a value of z, what are the values of x and y? For example, z == 3. Now, what were the original values of x and y? It might have been any of (x,y) = (1,2), of (2,1), or (1.5,1.5), or (-7000234,7000237), or infinitely many other choices.
Worse, your model will generally be nonlinear. And that means the inverse will very frequently result in multiple branches.
Essentially, anytime you have more inputs than outputs, then there will be no way to identify a unique inverse. At best, you could fix some of the variables at some arbitrary level, and then use a nonlinear solver (like fsolve) to solve for a solution for the rest of the variables. Even then, there will likely be multiple solutions per my comment above. Or, there may be no solutions at all.
Sorry, but you can't always get what you want. (I'm sure somebody said that before me.)
  4 Comments
Sam Chak
Sam Chak on 24 Mar 2025
@AARTHY, Let's naively assume that your ANFIS system can be represented as a 4th-degree polynomial. Thus, when the output value is 1.47, do you wish to display the input values in the command window in this manner?
p4 = @(k) [1, -258.517, 17688.4426, -228694.0812, 154976.718-k];
output = 1.47;
inputs = roots(p4(output))
inputs = 4×1
152.0000 90.0000 15.8000 0.7170
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
AARTHY
AARTHY on 25 Mar 2025
Thank you all for helping me understand this.Now I understand that I won’t give exact input values

Sign in to comment.

More Answers (0)

Categories

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

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!