help-octave
[Top][All Lists]
Advanced

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

Re: Interpolating with f(x) = a*x^b, where b might be a non-integer?


From: Juan Pablo Carbajal
Subject: Re: Interpolating with f(x) = a*x^b, where b might be a non-integer?
Date: Sun, 28 Oct 2012 15:43:32 +0100

On Sun, Oct 28, 2012 at 3:35 PM, Joanna Rutkowska <address@hidden> wrote:
> Hello, given a set of measurements, I would like to find the best fitting
> function of the form:
>
> f(x) = a*x^b, where a, b might be non integers. Here is a good example of
> such a fitting:
>
> http://www.flybrushless.com/prop/view/38
>
> Is there any toolbox in octave that I could use to easily obtain the a and b
> coefficients given a set of measurements?
>
> Thanks,
> joanna.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

Hi,

You can use the optim package[0] that includes curve fitting tools.
Now, you should notice that taking log at both sides of your equality
simplifies things a lot
log f(x) = log (a*x^b) = b * log (a*x) = b*(log(a) + log(x)) =
b*log(a) + b*log(x) = b*log(x) + C

Where C is a new name for the product b*log(a). So if you fit the
logarithms of measurements (scaling and shifting to avoid negative
values!) you can even use the function polyfit or regress (from
package statistics[1]).

[0] http://octave.sourceforge.net/optim/index.html
[1] http://octave.sourceforge.net/statistics/index.html

Cheers


reply via email to

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