| cpt_null_power | R Documentation |
When a detection comes back empty, the useful question is whether a
change of the size you care about would have been found. This runs
cpt_min_detectable() at the fit's own length, method and
penalty, with the noise level estimated from the series, and reports the
smallest shift detected with the requested power: changes smaller than
that could well be there and missed.
cpt_null_power(fit, power = 0.8, n_sim = 50, seed = NULL, ...)
## S3 method for class 'ggcpt_null_power'
print(x, ...)
## S3 method for class 'ggcpt_null_power'
tidy(x, ...)
fit |
A |
power |
Target power. Defaults to |
n_sim |
Simulations per power evaluation. Defaults to |
seed |
Optional seed, scoped to this call. |
... |
Further arguments for |
x |
A |
A ggcpt_null_power list with n, sigma (the
noise level used), jump (the smallest detectable change, in the
data's units), jump_sd (the same in noise standard deviations),
change_in (the fit's change type, which sets what jump
measures: a shift in the mean, a rise in the standard deviation, both,
or a trend, as cpt_power() defines them), power,
method and constant (TRUE when the series has no
variation, in which case nothing is simulated). With print() and
tidy() methods. A formula fit is refused: the simulation has no
covariates to draw.
Other inference:
cpt_abruptness(),
cpt_assumptions(),
cpt_attribute(),
cpt_attribute_event(),
cpt_confint_coverage(),
cpt_effect(),
cpt_gof(),
cpt_k_weights(),
cpt_robustness(),
cpt_screen(),
cpt_test_at(),
cpt_test_null()
set.seed(1)
fit <- cpt_detect(rnorm(100), method = "pelt")
cpt_null_power(fit, n_sim = 20, seed = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.