| cpt_effect | R Documentation |
The size of every change a fit reports, in the data's own units and standardised: the level before and after, their difference with an interval, the difference in noise standard deviations, the percentage change, and for count and waiting-time data the rate or hazard ratio.
cpt_effect(fit, level = 0.95, method = c("naive", "split"), seed = NULL, ...)
## S3 method for class 'ggcpt_effect'
print(x, ...)
## S3 method for class 'ggcpt_effect'
tidy(x, ...)
## S3 method for class 'ggcpt_effect'
autoplot(object, ...)
fit |
A |
level |
Confidence level for the intervals. Defaults to |
method |
|
seed |
Optional seed for |
... |
Further arguments for the re-run |
x |
A |
object |
A |
A ggcpt_effect tibble with one row per changepoint (per
changepoint and coordinate for a multivariate fit, per changepoint and
term for a regression fit): cp (and cp_index),
before, after, n_before, n_after,
delta, delta_lower, delta_upper (a Welch
interval), delta_std (the change in noise standard deviations,
the unit cpt_detect(min_effect = ) filters on),
pct_change, sd_before, sd_after,
sd_ratio, the family-specific ratio where it applies
(rate_ratio for Poisson counts, odds_ratio for binary
data, hazard_ratio for exponential waiting times, each with an
interval), selection_adjusted and method. With
print() and autoplot().
A change measured at a location the same data chose is biased upward:
the detector put the boundary where the two sides differ most, so the
difference it reports is the largest the noise allowed. The bias is
worst for the marginal detections, which are exactly the ones whose size
matters. method = "naive" rows carry selection_adjusted =
FALSE for that reason, except at a changepoint fixed in advance with
cpt_detect(fixed = ), which the data did not locate and which is
TRUE. method = "split" is honest about the size
(the measuring half never influenced the locations) and less precise
about the location (the locating half has half the data), and it assumes
the noise is independent from one observation to the next, since the
two halves are interleaved.
cpt_test_at() for a change at a date fixed in
advance, cpt_detect()'s min_effect.
Other inference:
cpt_abruptness(),
cpt_assumptions(),
cpt_attribute(),
cpt_attribute_event(),
cpt_confint_coverage(),
cpt_gof(),
cpt_k_weights(),
cpt_null_power(),
cpt_robustness(),
cpt_screen(),
cpt_test_at(),
cpt_test_null()
set.seed(1)
fit <- cpt_detect(c(rnorm(100, 10), rnorm(100, 12)), method = "pelt")
cpt_effect(fit)
counts <- c(rpois(100, 4), rpois(100, 8))
cpt_effect(cpt_detect(counts, method = "pelt", family = "poisson"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.