help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Curve fit


From: James Sherman Jr.
Subject: Re: Curve fit
Date: Mon, 22 Nov 2010 11:47:01 -0500

On Mon, Nov 22, 2010 at 11:37 AM, Martin Maxino <address@hidden> wrote:

or is f_0 a parameter too? oh no. im confused. lol

so f_0 and a are the parameters right?

but i already have data, and at t=0, f(t) = f_0 = something. Am i still
supposed to treat f_0 as an unknown parameter?
--
View this message in context: http://octave.1599824.n4.nabble.com/Curve-fit-tp3051324p3053965.html
Sent from the Octave - General mailing list archive at Nabble.com.

Usually you do, because you assume that your measurements are noisy, otherwise you could simply take two points and solve a system of equations to find the parameters.  So, if you have f(t) = f_0.*exp(-a*t), then you can do the first approach I mentioned, take the natural log of your measurements, so your model then looks like:
log(f(t)) = log(f_0) - a*t
then do a linear regression (polyfit of order 1) on this transformed measurement, so you'd get
log(f(t)) = m*x + b
(I used m this time to not get confused with your "a" variable).
then to calculate a and f_0:
a = -m
f_0 = exp(b)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]