comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » smooth function and rounding error
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
smooth function and rounding error [message #69209] Thu, 17 December 2009 15:20
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
Hi,

there is something I do not understand about smooth function, or
probably about numerics in general.
I implemented my version of smooth function, following the
prescription in
http://idlastro.gsfc.nasa.gov/idl_html_help/SMOOTH.html
I compared these two versions on same data, ranging from ~10^-1 to
~10^-5
and I get a relative error between the methods up to ~10^-1. it looks
rather big.
it is the same prescription on same data. does it happen because my
implementation is too naive and I accumulate rounding errors in it? or
because of smooth function itself?
I am not worried about performance here, just accuracy.

my implementation is the following:

function smooth_equivalent, A, width

n=n_elements(A)
y=DBLARR(n)
y=A
for i=(width)/2,n-(width)/2-1,1 do begin
y[i]=total(A[i-width/2:i+width/2-1])/width
endfor
RETURN, y

end

many thanks,
simona
[Message index]
 
Read Message
Previous Topic: A better way to find a dip (local minimum with certain conditions)
Next Topic: Odd Thing with Dialog_Pickfile

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 11:38:20 PDT 2025

Total time taken to generate the page: 6.88071 seconds