tmkurtosisTopN

Syntax

tmkurtosisTopN(T, X, S, window, top, [biased=true], [ascending=true], [tiesMethod=’latest’])

Arguments

biased is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.

Please see Time-Based Moving TopN Functions (tmTopN functions) for the parameters and windowing logic.

Details

After stably sorting S in the specified ascending order, the function calculates the kurtosis of the first top elements of X in a sliding window.

Return value: a vector of DOUBLE type

Examples

$ T=2023.01.03+1..10
$ X = [2, 1, 4, 3, 4, 3, 1, 5, 8, 2]
$ S = [5, 8, 1, , 1, 1, 3, 2, 5 ,1]
// The NULL values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation
$ tmkurtosisTopN(T,X,S,6,4)
[,,1.5,1.5,1.2798,1.628,2,2,1.8457,1.64]

$ T=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12 2023.01.13 2023.01.14 2023.01.15 2023.01.16
$ X=8 3 1 2 5 2 5 4 2 6
$ S=1 5 2 3 1 1 2 4 5 3
$ t=table(T as time, X as val, S as id)
$ select tmkurtosisTopN(time,val,id,6,4) as topN from t

topN

1.5

1.5

1.8457

2.1852

1.1522

1

1

2.1852

Related function: tmkurtosis