0
$\begingroup$

I'm not a mathematician, however I would like to find the right approach for my attempts to deal with a range of numbers presented to me, for which I have to determine what, at any given time, represent the maximum and minimum values arriving, lowering the maximum should there be a significant number of values arriving which are still higher than those reflecting minimal or considerably lower values (IOW, monitoring and shifting if required, the max reference up or down, according to varying relative peaks and troughs in the input). Thank you.

  • 0
    Thanks. The problem I am trying to solve is simply to process any series of numbers - (but a series with *some* shape, by which I mean not just violently fluctuating adjacent values, with the exception of end-of-subseries differences). An 'example' could be this series e.g.: 70,70,70,75,65,55,60,70,70,74,3,4,5,2,0,11,12,4,3,9,60,60,60,65,55,45,50,60,60,64 . . . . where the first ten values max at 75, the second sub-series represents minima, for which I'd ideally like to know the *maximum* of that subseries (12), and the 3rd subseries new upper values, from which I'd like the lowest (45).2012-09-17

1 Answers 1

0

Given what you explained in the comment above and your sample data:

data = {70, 70, 70, 75, 65, 55, 60, 70, 70, 74, 3, 4, 5, 2, 0, 11, 12,    4, 3, 9, 60, 60, 60, 65, 55, 45, 50, 60, 60, 64}; 

This will yield the numbers you want:

If[EvenQ@First@#2, Max@#1, Min@#1] &~MapIndexed ~Partition[data, 10] 

(* {55, 12, 45} *)

Note the implicit assumption that your data really is nicely partitioned into segments of 10 samples and that the first segment ("sub-series") is upper values.

Otherwise you may have to modify this to check some thresholds or other assumptions.