A. Kalten
2008-06-26 22:57:10 UTC
Hello,
I need some advice on solving a curve fitting problem.
Ordinarily, a curve fitting algorithm, such as polyfit
or wpolyfit in octave, will determine the coefficients of a
polynomial that best fits the empirical data. If the model
is a second degree polynomial, a x^2 + b x + c, the algorithm
will return the best coefficients a, b, and c.
The trouble I am having is that I need to fit a second
degree polynomial where some of the coefficients are
either already known or include another known parameter
as a factor. For example, I need to find the best value
for k in this equation:
k^2/4 x + k p x + p^2
where p is a known quantity.
Although there are three coefficients, there is really
only one unknown parameter, that is k. Using polyfit from octave
will return a, b, and c where a = k^2/4, b = k p, and c = p^2.
Solving the two equations for k gives values that
are significantly different (they differ in the second
decimal place).
Is there an algorithm available that allows some of the
parameters of the model to be predetermined or to include
some predetermined factor?
I suspect that the only solution would be to write a
custom least squares program.
AK
I need some advice on solving a curve fitting problem.
Ordinarily, a curve fitting algorithm, such as polyfit
or wpolyfit in octave, will determine the coefficients of a
polynomial that best fits the empirical data. If the model
is a second degree polynomial, a x^2 + b x + c, the algorithm
will return the best coefficients a, b, and c.
The trouble I am having is that I need to fit a second
degree polynomial where some of the coefficients are
either already known or include another known parameter
as a factor. For example, I need to find the best value
for k in this equation:
k^2/4 x + k p x + p^2
where p is a known quantity.
Although there are three coefficients, there is really
only one unknown parameter, that is k. Using polyfit from octave
will return a, b, and c where a = k^2/4, b = k p, and c = p^2.
Solving the two equations for k gives values that
are significantly different (they differ in the second
decimal place).
Is there an algorithm available that allows some of the
parameters of the model to be predetermined or to include
some predetermined factor?
I suspect that the only solution would be to write a
custom least squares program.
AK