Re: [R] Finding local minima and maxima

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Wed 15 Jun 2005 - 22:16:03 EST

Sean Davis wrote:

> I have data in the form of (x,y) pairs and would like to find local
> minima and maxima (typically the zeros of the 2nd derivative) of the y
> values. I looked at numericDeriv, but I don't have an "expression" per
> se. I looked at optim, also, but it looks like it will find only one
> "global" max or min. I can code up my own piecewise derivatives, but
> wondered if there is an existing function to do this.

If you don't have derivatives, and you don't have an expression, and you don't have a criteria how to minimize, please tell me of any known method that can handle your problem well enough.

You could look whether y[i-1] <y[i] and y[i+1]<y[i] if y is ordered according to x, if this most trivial and very non-robust method fits to your definition...

Uwe Ligges

> Thanks,
> Sean
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jun 15 22:19:16 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:40 EST