How find the function (equation) of the fitting surface using interpolation (method biharmonic)?

Hello, I would like some help to discover a function ( f(x,y) ) that describes a surface that was determined through a curve fitting using the Matlab tool "Curve fitting". Afterwards I selected "Interpolant" >> "Biharmonic".
I have three columns with numerical data. From these data, determined numerically, I would like to find an equation (f (x,y) ), which will give me the value of the z axis, if I inform the value of the x and y axis. So I searched for the feature in Matlab through curve fitting to find the function. I noticed that a fifth degree polynomial fit for x and y doesn't look good. So I had to turn to Interpolant. The software plotted a perfect figure, which properly fit the distribution of points. But I can't find the surface equation generated by Matlab.
If anyone can help me I would be very grateful

 Accepted Answer

Dear, thank you for your reply.
I figured the equation must be complicated, but even so I would like to know if it is possible for Matlab to provide it to me.
I'm sending a .dat file of my data, as well as the surface fit constructed using Matlab.
If you know of a way to generate the Equation, however complicated, please let me know.

4 Comments

Having a look the fitting function below
y = max(0,p11*(1/(1+exp(-(p1*x1+p6*x2+p16))))+p12*(1/(1+exp(-(p2*x1+p7*x2+p17))))+p13*(1/(1+exp(-(p3*x1+p8*x2+p18))))+p14*(1/(1+exp(-(p4*x1+p9*x2+p19))))+p15*(1/(1+exp(-(p5*x1+p10*x2+p20))))+p21)
Sum Squared Error (SSE): 0.558351715538511
Root of Mean Square Error (RMSE): 0.0542097153624364
Correlation Coef. (R): 0.990070888032855
R-Square: 0.980240363330166
Parameter Best Estimate
--------- -------------
p1 0.105182740442057
p2 0.354926306464671
p3 0.0560023578503546
p4 -0.308267404035613
p5 14.0756945085548
p6 0.0162222857246122
p7 -0.361983127007331
p8 0.133683115014576
p9 0.308179584760525
p10 64.9602099702488
p11 -470.551302428968
p12 -1.96231824914883
p13 17469.9931262452
p14 -3.86277636287894
p15 -0.98518764575908
p16 5.65943933792812
p17 -0.997994669731654
p18 -25.9853416269014
p19 -0.727516190798413
p20 -44.2198801317894
p21 473.704157266976
WOW !!
Thank you very much for that.
It is amazing.
Can you tell me how did you find this solution ?
I would like to be able to build this solution.
Let me ask, what mean y = max(0,...) ?
After the comma I believe it is the function found. But what does the number zero before the comma mean? I would also like to know what "max" means.
max(0,Something) returns an array the same size as Something in which each element is the maximum of 0 and the corresponding element of the array.
The maximum of 0 and any value is:
  • the value if the value is greater than 0
  • 0 and the value are the same if the value is exactly equal to 0
  • 0 if the value is less than 0
  • nan if the value is nan
  • a symbolic expression if the value is symbolic and the relationship to 0 cannot be determined
syms x real
max(0, [-2 0 2 x sin(x) exp(x)].')
ans = 
Notice that MATLAB was able to reason that with real values of x, that exp(x) is at least 0
Hi, the fitting function was get through Neural Network fitting procedure, with the activation function of ReLU (Rectified Linear Unit) in output layer of neural network, as show below:

Sign in to comment.

More Answers (1)

This question is asked hundreds of times on the site. The answer is, there is no simple "equation" you can write down. That is true for any such spline or variant of a spline. Instead, you would find dozens or even hundreds of coefficients in a complicated function. Something that a computer has no problem with, but no simple nice looking function.
Sorry.
As far as just finding a nice function you can use, that may depend on finding a model for the problem. And that sometimes takes some ingenuity, some understanding of the process that generated your data. We are not given that here of course. We don't even see your data.

Categories

Products

Release

R2021a

Community Treasure Hunt

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

Start Hunting!