MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Find maxima in lists of data

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105795] Re: [mg105772] Find maxima in lists of data
  • From: Herman Kuun <oomkoos1 at gmail.com>
  • Date: Sat, 19 Dec 2009 06:26:33 -0500 (EST)
  • References: <200912181123.GAA16525@smc.vnet.net>

David,

If you only interested in position[s]  where maximums occur for a
difference list, this may help.

lst = {1, -2, 3, 1, -3, -2, 3}

Position[Differences[lst], Max[Differences[lst]]] // Flatten

{2, 6}

Best

On Fri, Dec 18, 2009 at 1:23 PM, David <david.leipold at tu-ilmenau.de> wrote:

> I need to find maxima in lists of numerical (measured) data. My basic idea
> is to apply Differences[] to the data and find pairs which differ in Sign[].
> My working solution is:
>
> AllMaxima[lst_] :=
>  Flatten[Position[
>    Partition[Differences[lst], 2, 1], {x_, y_} /;
>     Sign[x] > Sign[y]]];
>
> which behaves as i want. Since it was hard to work this out, i ask myself
> whether i haved overlooked the simple solution. So does anybody know the
> really cool way to achieve this?
>
> Greets!
>
>


-- 
Best
Herman
------------------------------- CUT -----------------------------
The 10 commandments of Network Administration ( www.newsforge.org)
I. Thou shalt make regular and complete backups
II. Thou shalt establish absolute trust in thy servers
III. Thou shalt be the first to know when something goes down
IV. Thou shalt keep server logs on everything
V. Thou shalt document complete and effective policies and procedures
VI. Thou shalt know what cable goes where
VII. Thou shalt use encryption for insecure services
VIII. Thou shalt not lose system logs when a server dies
IX. Thou shalt know the openings into your servers
X. Thou shalt not waste time doing repetitive and mundane tasks


  • Prev by Date: Re: User defined color function for discrete data set?
  • Next by Date: Re: Trick to create vector metafile in Mathematica 7.0 for copy &
  • Previous by thread: simplification rule for infinite sum
  • Next by thread: Re: Find maxima in lists of data