I Best way to fit three functions

  • I
  • Thread starter Thread starter LCSphysicist
  • Start date Start date
  • Tags Tags
    Fit Functions
AI Thread Summary
The discussion focuses on finding the optimal values for variables x, y, z, and t in three highly non-linear functions defined by f, g, and h, given limited data points. The proposed approach involves minimizing the residues for each function simultaneously, potentially using the Lagrangian method to manage the constraints. However, the complexity of the non-linear functions raises concerns about the feasibility and efficiency of coding such a solution. An alternative suggestion is to combine the requirements of all data points into a single equation and apply Newton's approximation method for root finding. Ultimately, defining a clear mathematical criterion for "best fit" is essential for effective minimization.
LCSphysicist
Messages
644
Reaction score
162
TL;DR Summary
I have basically three set of data, each set corresponding to a function, so that the data should fit the function, and each function is dependent of 4 parameters. How to find the best 4 parameters that fit it?
So I have $$f(x,y,z,t,n) = 0,g(x,y,z,t,n) = 0,h(x,y,z,t,n) = 0 $$ and i need to find the best ##[x,y,z,t]## that fit the data, where n is the variable. Now, the amount of data for each function is pretty low (2 pair for f (that is, two (n,f)), 3 pair for g and another 3 pair for h)

The main problem here is: the functions are highly non-linear. So i have no idea how can i write a program to find the best x,y,z,t!

I have thought of try to simultaneously minimize the residues, for example, for f:
$$R(f) = \sqrt{(f(x,y,z,t,n_1) - y_1)^2+(f(x,y,z,t,n_2) - y_2)^2}$$
(where y is the f obtained on thee data at n_1 (the pair i have cited above))

But this minimization subject to the condition that ##R(g), R(h)## (here, three terms) also be minimum. So maybe i could use Lagrangian method:
$$dR(h) = \lambda dR(g) + \mu dR(h)$$
But this is going to be extremelly massive and tedius to write a code, and the code will take days to run. As i said, the functions are non-linear.

Any method suggestion? or program suggestion?
 
Mathematics news on Phys.org
Extremely massive and tedious is probably the best you can get. If it was one occurrence, I'd advise WolframAlpha or plot the 3 functions and visually pick the best fit (further improved with Newton's approximation method).

For now I'd advise to combine the requirements for all the data points on f, g and h and rewrite them as ##function - data = 0## and then the square of the left hand side must be minimal for all data points simultaneously: so take the derivative with respect to ##n## of these squares all added up and approximate where this formula in ##n## equals 0 using Newton's approximation method or some better root finding algorithm.

Wiki on Newtons method
 
Last edited:
You'll need to decide what you consider "best fit". Write that down mathematically as fitquality(x,y,z,t), then feed it in a program for minimization.

The sum of squared residues for all data points (data point minus the applicable function) sounds like a good start.
 
  • Like
Likes Maarten Havinga
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Back
Top