[time-nuts] Curve fitting
Bruce Griffiths
bruce.griffiths at xtra.co.nz
Wed Dec 23 06:30:10 UTC 2009
Mark Sims wrote:
> A disciplined oscillator can be modeled by an equation like:
>
> OSC_FREQ = DRIFT_RATE*TIME + TEMPCO*TEMP + OSC_GAIN*DAC_VOLTAGE
>
> For a set of data I know TIME, TEMP, FREQ, DAC_VOLTAGE and OSC_GAIN (a constant in Hz/V).
>
> What the good Lady Heather wants to calculate is the DRIFT_RATE (Hz per sec) and TEMPCO (Hz per degree C).
>
> Does anybody have any code (preferably nice and simple C code) to calculate those two parameters from a data set containing the other 5 values.
>
>
Try one of the Lapack derivatives such as clapack, Lapack++ etc
However you will need the optimised BLAS as well.
Using an orthogonal decomposition method (eg QR) or for difficult (near
singular) cases SVD (or even Householder's method) is better than using
the least squares solution directly.
Bruce
More information about the time-nuts
mailing list