help-octave
[Top][All Lists]
Advanced

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

Re: Regarding Curve fit


From: Ben Abbott
Subject: Re: Regarding Curve fit
Date: Mon, 25 Aug 2008 09:03:54 -0400

On Monday, August 25, 2008, at 06:31AM, "Raghavendra K" <address@hidden> wrote:
>Hi,
>  I am trying to use Weibull Curve fit in octave.
>Suppose x = [1 2 3]
>y=[0.4 0.8 0.9]
>I want to find the next value of y(4) for x = 4 using weibull distribution.
>How do I go about it?
>Thanks for the help.
>

Raghavendra,

I'm running 3.0.1 and the optimization package from OctaveForge. The code below 
appears to work for me ... however, I haven't tested it thoroughly.

x = [1.0 2.0 3.0];
y = [0.4 0.8 0.9];
pin = [2 1];

F = 
inline('(pin(1)/pin(2))*(x/pin(2)).^(pin(1)-1).*exp(-(x/pin(2)).^pin(1))','x','pin');

[f, p, kvg, iter] = leasqr (x(:), y(:), pin(:), F)

## f = column vector of values computed: f = F(x,p).
## p = column vector trial or final parameters. i.e, the solution.
## kvg = scalar: = 1 if convergence, = 0 otherwise.
## iter = scalar number of iterations used.




reply via email to

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