How to Convert a Nonlinear Function into Linear for Quadratic to Linear Fit?

Igor_S
Messages
98
Reaction score
0
I have a function y = \sqrt{ax^2 + bx +c}, and 2 sets of points {x_i},{y_i} that need to be fit on this curve. First in this problem, I need to somehow convert this nonlinear function into linear and then apply least square methods to determine a,b,c.
What I came up is ofcouse squaring both sides, removing root. Now I have: y^2 = ax^2 + bx + c. I tried factoring this into a(x-x_1)(x-x_2) but don't think this is better form. I'm not sure how is this even possible, there are 3 numbers to be determined as I can find only 2 equations from least square method (slope & intercept). How to determine a,b,c ? I know how to do it in eg. Mathematica, but I'm writing this as a FORTRAN program, so I need to write exact procedure. I don't know how to do nonlinear fits "by hand".

Thanks.P.S. Simpler example of what is supposed to be done (at least I think) is function y = ax^n. Here you just take log of both sides to get: log(y) = nlog(x) + log(a), then calculate log(y_i) and log(x_i) and slope of the line with log(x) and log(y) as variables is n, with intercept log(a).
 
Last edited:
Physics news on Phys.org
Somewhat similar to the Log example, you have 3 var's in the quadratic problem: y^2, x^2 and x. You can calculate a, b and c by inputting these 3 var's into a standard regression software (E.g. SAS); or you can write your own OLS routine to calculate them by using the formula \hat\beta = (Z'Z)^{-1}Z'(y^2) where \beta = (a,b,c)\text{ and }Z=(x^2,x,1).
 
Last edited:
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Back
Top