Berserk Docs
Scalar FunctionsSeries Functions

series_stats

Computes statistics (min, max, avg, stdev, variance) for a numeric series.

An absent element (null) makes every statistic null unless ignore_nonfinite is true, which computes over the present values and also skips infinities. Also reports sum (over the retained values) and len (the input length, including skipped elements). An infinity propagates like an absent element unless ignore_nonfinite is true.

Syntax

series_stats(series, ignore_nonfinite)

Parameters

Prop

Type

Returns: dynamic

Examples

Example 1 — Compute statistics for crossing times

print series_stats(dynamic([48, 72, 36, 55, 60]))
print_0 (dynamic)
[36.0,2,72.0,1,54.2,12.006664815842909,144.16000000000003,271.0,5]

Example 2 — Ignore null values when computing statistics

print series_stats(dynamic([48, 72, null, 55, 60]), true)
print_0 (dynamic)
[48.0,0,72.0,1,58.75,8.757139944068497,76.6875,235.0,5]

On this page