How to develop equation from the database ?

Excuse me every one. I have the scattering data (case selection data) as show in the figure below. I want to develop the equation to predict 'y' value by input the 'x' and 'TH'. The equation shows the typical form like: y = f(x,TH). How to do it ? Thank you very much.

Réponses (1)

Saurabh Chaudhary
Saurabh Chaudhary le 3 Jan 2023
Modifié(e) : Saurabh Chaudhary le 3 Jan 2023

0 votes

You can fit a curve using curve fitting toolbox (enter "cftool" in command window to open it) and obtain the equations and write a small script to select the equation accoding to TH value.

9 commentaires

Lyhour Chhay
Lyhour Chhay le 3 Jan 2023
thank you very much sir. I understand your approache. However, my objective is want to generate the exact equation for manual calculation. Is there any alternative approach ?
Alex Sha
Alex Sha le 4 Jan 2023
If possible, upload your data file please.
Lyhour Chhay
Lyhour Chhay le 4 Jan 2023
Dea sir, Alex Sha,
I have upload the database in the excel file. Thank you very much
From data you can not get the exact equation. The equation you find from the curve fitting or machine learning it have some error.
Lyhour Chhay
Lyhour Chhay le 4 Jan 2023
Dear Sir, Saurabh Chaudhary,
Thank you very much for your discussion. Therefore, is there any algorithm or approch that I can get it ? How about I create two equation?
Saurabh Chaudhary
Saurabh Chaudhary le 4 Jan 2023
Modifié(e) : Saurabh Chaudhary le 4 Jan 2023
One is the curve fitting tool and another you can use least square algorithm or machine learning toolbox also can be used.
Refer to the fitting function and result below:
Sum Squared Error (SSE): 0.000562300835691918
Root of Mean Square Error (RMSE): 0.00395214722120885
Correlation Coef. (R): 0.999856659423475
R-Square: 0.99971333939347
Parameter Best Estimate
--------- -------------
p1 1.60459267721019
p2 -0.207764681801805
p3 -0.0792360032379987
p4 5.07935211534004E-5
p5 9.77939357085156E-5
p6 -0.101574648932732
p7 9.84064177094815
Lyhour Chhay
Lyhour Chhay le 4 Jan 2023
Dear Sir, Alex Sha,
I really appreciate your kindess. it is really amazing of your equation. Thank you very much.
it would be better if you could tell me how you create this equation. Did you create randomly ? or any suggesting tool ? could you tell me your algorithm to create the equation ?
Best Regards,
CHHAY LYHOUR
Hi, there are some other softwares which can search functions with the better fitting to the data provided, automatically.
You can also use Neural Network to fit your data, the function is much long, but with more better result:
where x1=TH, x2=x;
Sum Squared Error (SSE): 6.15367933063669E-6
Root of Mean Square Error (RMSE): 0.000413443511210577
Correlation Coef. (R): 0.999998431427883
R-Square: 0.999996862858226
Parameter Best Estimate
--------- -------------
p1 -0.0184998266667526
p2 -0.00170324878988054
p3 0.00105902753507986
p4 -8.63188539136108E-5
p5 13.3141311137491
p6 -0.010077245280387
p7 -769.681178210069
p8 113.441478800875
p9 -41.899708039828
p10 -46.1202975365195
p11 325.53145620631
p12 1467.54651172898
p13 -22.9188474020333
p14 0.975904984363179
p15 -4.72158876536306
p16 -660.31030174081
p17 -6.67856367002313
p18 51.8661729374925
p19 44.4703308742898
p20 22.8349571901207

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by