Skip to contents

Counts local maxima and minima and compares to the expectation \(2(n-2)/3\) under randomness. Reproduces randtests::turning.point.test.

Usage

morie_turning_point_test(x)

Arguments

x

Numeric vector.

Value

A list with statistic (z), p.value, tp (turning-point count), method.

Examples

set.seed(1); morie_turning_point_test(rnorm(60))$p.value
#> [1] 0.07809111