Difference between revisions of "CumMin and CumMax"
m (Lchrisman moved page CumMin to CumMin and CumMax: Name Better reflects fact that both are on same page) |
(EW19271 Window parameter) |
||
Line 3: | Line 3: | ||
[[Category:Transforming functions]] | [[Category:Transforming functions]] | ||
− | == CumMin(x, I'', passNull, reset'') == | + | {{ReleaseBar}} |
− | == CumMax(x, I '', passNull, reset'') == | + | |
+ | == CumMin(x, I'', passNull, reset{{Release|5.5||,window}}'') == | ||
+ | == CumMax(x, I '', passNull, reset{{Release|5.5||,window}}'') == | ||
Returns an array with each element being the minimum or maximum of all preceding elements of «X» along dimension «I» up to, and including, the corresponding element of «X». | Returns an array with each element being the minimum or maximum of all preceding elements of «X» along dimension «I» up to, and including, the corresponding element of «X». | ||
Line 51: | Line 53: | ||
«Reset» can be used to restart the progressive min or max each time some state change occurs. In such a scenario, the «reset» parameter is set to <code>True</code> at the first instant (along «I») that the system is in the new state. | «Reset» can be used to restart the progressive min or max each time some state change occurs. In such a scenario, the «reset» parameter is set to <code>True</code> at the first instant (along «I») that the system is in the new state. | ||
+ | |||
+ | === Window === | ||
+ | ''New to [[Analytica 5.5]]'' | ||
+ | |||
+ | When «window» is specified as a positive integer, does a windowed cum min or cum max. In other words, returns the minimum (or maximum) value among the most recent «window» points. | ||
== See Also == | == See Also == |
Revision as of 01:29, 23 July 2020
New to Analytica 5.3
Release: |
4.6 • 5.0 • 5.1 • 5.2 • 5.3 • 5.4 • 6.0 • 6.1 • 6.2 • 6.3 • 6.4 • 6.5 |
---|
CumMin(x, I, passNull, reset,window)
CumMax(x, I , passNull, reset,window)
Returns an array with each element being the minimum or maximum of all preceding elements of «X» along dimension «I» up to, and including, the corresponding element of «X».
Examples
I :=
1..7
X :=
Array(I, [5, 2, 1, 8, -3, 0, 4])
CumMin(X, I) →
[5, 2, 1, 1, -3, -3, -3]
{indexed byI
}
CumMax(X, I) →
[5, 5, 5, 8, 8, 8, 8]
{indexed byI
}
Optional Parameters
PassNull
«PassNull» is an optional boolean parameter that defaults to False
. When it is omitted or explicitly set to False
, CumProduct ignores Null values. In that case they have essentially the same effect as a one, unless they happen to be the first value in «X», in which case they are passed since no numeric values are yet obtained.
When «passNull» is explicitly set to true, then Null values are passed through as Null in the result.
J := 1..11
X2 :=
Array(J, [Null, Null, 4, 2, Null, Null, 2, -1, 3, 2, Null])
CumMin(x2, J) →
[Null, Null, 4, 2, 2, 2, 2, -1, -1, -1, -1]
{ Indexed byJ
}
CumMin(X, J, passNull: false) →
[Null, Null, 4, 2, 2, 2, 2, -1, -1, -1, -1]
{ Indexed byJ
}
CumMin(X, J, passNull: true) →
[Null, Null, 4, 2, Null, Null, 2, -1, -1, -1, Null]
{ Indexed byJ
}
CumMax(X, J, passNull: true) →
[Null, Null, 4, 4, Null, Null, 4, 4, 4, 4, Null]
{ Indexed byJ
}
Reset
The optional «reset» parameter accepts an array of boolean values indexed by «I». At the positions where «reset» is true, CumMin or CumMax starts over.
I :=
[1, 2, 3, 4, 5, 6, 7]
X :=
Array(I, [5, 2, 1, 8, -3, 7, 5])
R :=
Array(I, [0, 0, 1, 0, 0, 1, 0])
CumMin(X, I, reset: R) →
[5, 2, 1, 1, -3, 7, 5]
{ Indexed byI
}
CumMax(X, I, reset: R) →
[5, 5, 1, 8, 8, 7, 7]
{ Indexed byI
}
«Reset» can be used to restart the progressive min or max each time some state change occurs. In such a scenario, the «reset» parameter is set to True
at the first instant (along «I») that the system is in the new state.
Window
New to Analytica 5.5
When «window» is specified as a positive integer, does a windowed cum min or cum max. In other words, returns the minimum (or maximum) value among the most recent «window» points.
Enable comment auto-refresher