[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2 dimensional error and polyfitting
From: |
Ben Abbott |
Subject: |
Re: 2 dimensional error and polyfitting |
Date: |
Mon, 17 Mar 2008 09:20:32 -0700 |
On Monday, March 17, 2008, at 11:03AM, "Kyndig" <address@hidden> wrote:
>
>Could someone please advise me on how to accomplish what wpolyfit does but
>with an error input for the x values as well as y. In other words,
>currently wpolyfit only accepts a "dy" argument. I'd like to input a "dx"
>also. Can this be done? Thank you for your time.
>--
>View this message in context:
>http://www.nabble.com/2-dimensional-error-and-polyfitting-tp16075563p16075563.html
>Sent from the Octave - General mailing list archive at Nabble.com.
>
I don't know what your application is, but if the slope of the resulting
polynomial fit is not terribly sensitive to changed to dx and/or dy, you might
try an approach like the one below
function [p, s, mu] = wpolyfitdxdy (x, y, dx, dy, N)
p = wpolyfit (x, y, dy, N);
dydx = polyval (polyder (p, x));
dy = dy + dydx.*dx;
[p, s, mu] = wpolyfit (x, y, dy, N);
endfunction
Ben