[Scilab-users] Wrong number of arguments? exclusive) to exclusive)

scilab.20.browseruk at xoxy.net scilab.20.browseruk at xoxy.net
Tue Apr 5 22:36:43 CEST 2016


Claus,
> 
> You can convert the code for Barlett3p to a Median3p, simply by
> replacing the weights (0.25 0.50 0.25) with equal weights ... i.e. 0.333
> 0.334 0.333 ...

I extrapolated a barlett5p() function from your example:
function [out]=bartlett5p(indata) 
     out = indata;
     if length(indata) > 3 then
         out( 3:$-2 ) = 0.2 * indata( 1:$-4 ) + 0.2 * indata( 2:$-3 ) + 0.2 * indata( 3:$-2 ) + 0.2 * indata( 4:$-1 ) + 0.2 * indata( 5:$ );
     end 
endfunction

And tried various sets of weights: (0.1, 0.2, 0.4, 0.2, 0.2 etc.) before settling on the "median5p()" set above.

The result (as shown in the attachment) is that whilst it addresses the cases where the barlett3p() leaves inflections in the dataset (albeit much reduced); it leaves inflections where the barlett3p() doesn't :(

> 
> Someone suggested to compare the raw data with the smoothed data - and
> determine persistent issues. Maybe delete the tricky data that doesn't
> ensure convex space ... I think that's your best option because the
> remaining data is true to your original data. If deleting a data point
> is of concern - the alternative is to replace the bad data point with a
> data point interpolated between the surrounding data.

Yes. I'm rapidly coming to the conclusion that I need to stop looking for a continuous 'mathematical solution' to this problem and return to the prosaic, procedural code that detects negative slopes and simply deletes the points that cause them, that I had when when I first asked the question here. 

Since there doesn't seem to be any nice way of coding that in SciLab, and I'm vastly more comfortable in Perl, I'll code my solution there where I won't be running into anomalies that bring me back here asking dumb question every five minutes.

Thanks for your time and observations; they've been very helpful.

Cheers, Buk.

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/manager
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disconsBartlett.png
Type: image/png
Size: 73984 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20160405/a4dd86e3/attachment.png>


More information about the users mailing list