help-octave
[Top][All Lists]
Advanced

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

Re: curve fitting


From: James Sherman Jr.
Subject: Re: curve fitting
Date: Fri, 19 Oct 2007 17:49:28 -0400

So it sounds like you would be interested in the function leasqr.  For
just a quick example, if you wanted to fit a polynomial of rank 2 to
your data, the lines would look something like:
> F = @(x,p) p(3)*x.^2+p(2)*x+p(1);
> p0 = [1;1;1]; %initial guess at the parameters
> [f, p] = leasqr(x, y, p0, F, 0.0001, 20, wt);

where wt is the weights that you want for each x.  Then you can simply
plot it by:
> plot(x, f)

Hope this helps.

On 10/19/07, Cian-Leaclainne Rebekah Zybutz <address@hidden> wrote:
>
> Hi,
> I have a specific problem that I am trying to work out with octave right now.
> I have an array of data in it includes a set of x values, y values, xmin 
> error, xmax error, ymin error, and ymax error.
> I would like to plot the data with asymmetric errorbars (which I already know 
> how to do), but also, with a weighted least-squares fit curve to the data.
> Can you please help me with that?
> thankyou,
> -Cian
> _________________________________________________________________
> Express yourself with free Messenger emoticons. Get them today!
> http://www.freemessengeremoticons.ca/?icid=EMENCA122
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>


reply via email to

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