[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Omitting values for Leasqr
From: |
aegreen |
Subject: |
Re: Omitting values for Leasqr |
Date: |
Wed, 9 Mar 2011 08:01:01 -0800 (PST) |
Thanks Francesco, setting the weight to zero, and eliminating the y AND
corresponding x values worked as well.
For example using leasqr with these 3 vectors are equivalent
x = [1, 2, 3, 4, 5]
y = [10, 10000000, 12, 15, 16]
weights = [1, 0, 1, 1, 1,]
are equivalent to:
x = [1, 3, 4, 5]
y = [10, 12, 15, 16]
weights = [1, 1, 1, 1]
BUT not to:
x = [1, 2, 3, 4]
y = [10, 12, 15, 16]
weights = [1, 1, 1, 1]
nor:
x = [1, 2, 3, 4, 5]
y = [10, NaN, 12, 15, 16]
weights = [1, 1, 1, 1, 1,]
Francesco Potortì wrote:
>
>>I am trying to fit an exponential curve to data using the leasqr()
function.
>>I can fit the data no problem. However my data has a lot of noise and our
>>policy is to remove data points that are outside of 2 standard deviations
of
>>the mean of the residuals from an exponential curve that is initially fit
to
>>the data. I have tried replacing the values with NA or NaN and it exits
with
>>an error of "CONVERGENCE NOT ACHIEVED!" my temporary solution is to
replace
>>the value with a local mean, however ideally I would like to omit the
value
>>without changing the data.
>
> The leasqr function has the possibility of specifying weights for each
> data point. You just set weight 1 to everything but the data you want to
> ignore, whose weight you set to a low value.
>
> Or you just create a new vector without the offending data points and do
> the fitting on that one.
>
> --
> Francesco Potortì (ricercatore) Voice: +39 050 315 3058 (op.2111)
> ISTI - Area della ricerca CNR Fax: +39 050 315 2040
> via G. Moruzzi 1, I-56124 Pisa Email: address@hidden
> (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
--
View this message in context:
http://octave.1599824.n4.nabble.com/Omitting-values-for-Leasqr-tp3342535p3343877.html
Sent from the Octave - General mailing list archive at Nabble.com.