crit_val_op

Notedocblock
crit_val_op(chart_choice, m, n_patterns; alpha=0.05)

Compute the asymptotic critical value of the ordinal-pattern test test_op.

The critical value depends only on the chart, on the pattern length m, on the number of patterns n_patterns and on the level alpha, but not on the data. In a Monte Carlo study it can therefore be computed once per sample size and reused in every replication, which is much faster than calling test_op in the loop: test_op additionally evaluates the p-value, and for Shannon(), ShannonExtropy() and DistanceToWhiteNoise() that means a numerical evaluation of a generalized chi-squared distribution per call.

x = randn(500)
n = length(x) - 2
crit = crit_val_op(Persistence(), 3, n)
abs(chart_stat_op(stat_op(x; chart_choice=Persistence())[2], Persistence())) > crit