problem with extremum() function

5 views
Skip to first unread message

kingsley

unread,
Oct 29, 2009, 10:06:25 AM10/29/09
to fityk-users
Hi
I am using the extremum() function to find the mode of my fitted
peaks.
My data range is from 100 to 800, but individual peaks are far
narrower. However, to simplify my script I specify the full data range
in the arguments to extremum(%_1, 100, 800) like so.
When I have a very narrow yet intense peak at 600, the value returned
by extremum is the range start argument rather than the actual
location of the peak, unless I increase the range start argument.
here is my actual result from several tests:
=-> i extremum(%_1,160,800)
160
=-> i extremum(%_1,170,800)
170
=-> i extremum(%_1,180,800)
598.509

(For a narrow gauss peak, 560 - 630, center 599, height 2120, width
11, skew -.04)

Note that unless i specify a range start > 170, it returns the range
start value instead of the proper peak location of 598.5. All range
start arguments from 100 to 170 incorrectly return the actual range
start value itself!

Seems to be a bug????
Kingsley

Marcin Wojdyr

unread,
Oct 29, 2009, 8:42:01 PM10/29/09
to fityk...@googlegroups.com
On Thu, Oct 29, 2009 at 15:06, kingsley <king...@burlinson.id.au> wrote:
>
> Hi
> I am using the extremum() function to find the mode of my fitted
> peaks.
> My data range is from 100 to 800, but individual peaks are far
> narrower.
[...]

> =-> i extremum(%_1,170,800)
> 170
> =-> i extremum(%_1,180,800)
> 598.509

That's because extremum() is looking for derivative = 0, and I guess
the value of derivative of %_1 for x=170 is almost zero (the very
small numbers, something like 10^-300 I think, are considered zero).
With the algorithm that is used (which is simple bisection) there is
no easy way to find the real extremum.

Best,
Marcin

--
Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr/

Reply all
Reply to author
Forward
0 new messages