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:07:13 -0500

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

Hi,

Liam, i need help again.

I want to curve fit a set of data points using an exponential decay
function.

Suppose its a decay curve of sound.

Could you please illustrate it for me how to do it?

I don't know if this function would work: f(x) = f_0*e^(-xt), where f_0 is
the initial value of f(x) at t=0;

Thanks.
--
View this message in context: http://octave.1599824.n4.nabble.com/Curve-fit-tp3051324p3053703.html
Sent from the Octave - General mailing list archive at Nabble.com.

Hi Martin,

There may be more elegant ways to do it, but you could take the natural log of f(x), then perform a simple linear regression on the log of f(x):
ln(f) = ln(f_0) - xt
so a linear regression would fit parameters y = a + bx, thus
a = ln(f_0)
b = -t

Ah, I just realized that you only have one parameter here (f_0).  So, couldn't you just calculate:
f_0 = f(x)/e^(-xt)
Then calculate the average of these points to estimate f_0?

Hope this helps.

reply via email to

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