Multivariate nonlinear equation generation

I have data for 5 water quality variables, 4 independent (x) and 1 dependent (y) (nitrite), data attached. I am needing help with developing code that will generate a non-linear equation, and the constants associated based on the data. Is this possible?
I tried using the curve fitting app with "custom equation" which is similar to what I am looking for, but it is only for one x variable and not multiple.
Any suggestions would be greatly appreciated!

Answers (1)

No, it is not possible in the form stated.
Given any finite number of points expressed in finite precision, then there are an uncountable infinity of equations that fit the data perfectly (to within round-off error.)
Because there is an uncountable infinity, the probability that any one equation will be the "right" equation, is zero. 1/infinity is 0.
Therefore, it is mathematically impossible to automatically generate equations in any meaningful way.
The situation changes if you have a finite list of models whose parameters are to be fitted. In theory in such a situation, you could look for the model out of the list that had the best fit. In practice, it is common for mathematical accidents to result in widely different models to come out as good to within any reasonable error bounds. In practice, if you create some synthetic data with even a little noise, and run it through automated fitting algorithms, it is common for a different model to fit a little better than the one matching the true model.

3 Comments

Do you know of any automatic fitting algorithms that would work here?
Which models would you like to fit against?
Is it correct that all values of dependent (y) (nitrite) are zero?

Sign in to comment.

Categories

Asked:

on 23 Jun 2021

Commented:

on 24 Jun 2021

Community Treasure Hunt

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

Start Hunting!