help-octave
[Top][All Lists]
Advanced

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

Re: a-b+b != a


From: stn021
Subject: Re: a-b+b != a
Date: Mon, 4 Sep 2017 19:18:10 +0200

2017-09-04 19:00 GMT+02:00 Mike Miller <address@hidden>:
> On Mon, Sep 04, 2017 at 18:50:29 +0200, stn021 wrote:
>> the idea here is to add weights to the result.
>>
>> res = y + weights .* ( res-y )
>>
>> If weights==1 then res should remain unchanged. Only it doesn't.
>
> If this property is important, then you should probably just add a
> special case
>
>     if (weights != 1)
>       res = y + weights .* (res - y);
>     endif
>
> --
> mike
Hi Mike,

not sure about this. The important property is that the weights are
applied correctly. So weights==1/2 should lead to half the value just
as weights==1 should lead to an unchanged value.

Just to be sure: weights is a vector, not a scalar. So some elements
can be 1 and others can be something else at the same time. These are
supposed to be statistical weights assigning more or less importance
to observed data.

Stefan



reply via email to

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