
Root Confidence Intervals for Every Datestamped Episode
Source:R/explosive_root.R
root_ci_datestamp.RdConvenience wrapper that runs explosive_root/root_ci
on every episode in a datestamp result, so root inference
doesn't have to be hand-run per episode.
Usage
root_ci_datestamp(object, ds, level = 0.95, type = c("normal", "cauchy"))Arguments
- object
A
radf_obj(or subclass) thatdswas computed on – needs the original data, retrieved via its"mat"attribute.- ds
A
datestampresult computed onobject. Setmin_durationthere to exclude episodes too short for reliable root inference.- level
Confidence level, passed to
root_ci(default 0.95).- type
CI type, passed to
root_ci(default"normal").
Value
A named list (one element per series in ds; the panel
sieve-bootstrap case, whose ds entry is named "panel" and
has no single corresponding series, is dropped with a warning), each a
data frame with one row per datestamped episode: Start, End,
rho, rho_lower, rho_upper, doubling_time,
doubling_time_lower, doubling_time_upper.
Details
Not folded into summary.radf_obj: that function's
existing S3 dispatch (summary_radf.mc_cv/.wb_cv/.sb_cv)
is built entirely around radf_cv test-statistic critical values –
root CIs are a different kind of output (needing a datestamp()
result, not a radf_cv) with no natural fit in that dispatch chain.
A standalone function keeps this addition to the size the enhancement
notes actually scoped ("a small follow-up"), rather than restructuring
summary()'s shared machinery to accommodate a fundamentally
different kind of result.
Root inference on a very short episode is statistically meaningless (the
same way it would be calling explosive_root directly on 2-3
points) – this function doesn't filter episodes itself, since
datestamp already has a min_duration argument for
exactly this; set it there before piping into this function, rather than
expecting this function to second-guess what counts as "too short".