| estimate_stability | R Documentation |
Experimental. The resampling design is methodologically grounded (block bootstrap for dependent data; edge-stability summaries in the spirit of bootnet), but unlike the estimators in this package it has no external reference implementation to validate against, and its interface, defaults, and reported statistics may change in a future release.
Refit an idiographic estimator across deterministic block resamples and
summarize edge-level stability. Blocks preserve within-block time order:
subject-day blocks when id and day are supplied, subjects when only id
is supplied, days when only day is supplied, or consecutive row blocks for
a single series. Duplicate blocks receive temporary ids/day labels before
fitting so lag construction never connects two sampled copies.
estimate_stability(
data,
vars,
estimator = c("var", "graphical_var", "mlvar", "usem", "gimme"),
id = NULL,
day = NULL,
beep = NULL,
n_resamples = 100L,
resample = c("block", "split_half"),
block_size = NULL,
threshold = 1e-08,
seed = NULL,
keep_fits = FALSE,
...
)
data |
A |
vars |
Character vector of variable names. |
estimator |
|
id |
Character. Name of the person-ID column, or |
day |
Character. Name of the day/session column, or |
beep |
Character. Name of the measurement-occasion column, or |
n_resamples |
Integer number of bootstrap/split resamples. |
resample |
|
block_size |
Integer or |
threshold |
Numeric. Absolute weight above which an edge is counted as
selected. Default |
seed |
Optional integer seed for deterministic resampling. |
keep_fits |
Logical. Store successful resampled fits in the returned
object? Default |
... |
Further arguments passed to the estimator. |
A stability_result with $stability edge statistics, $original
fit, $resample_edges, $failures, and $config.
set.seed(1)
d <- data.frame(id = 1, day = rep(1:4, each = 12),
beep = rep(1:12, 4),
A = rnorm(48), B = rnorm(48), C = rnorm(48))
st <- estimate_stability(d, vars = c("A", "B", "C"), id = "id",
day = "day", beep = "beep",
n_resamples = 5, seed = 1)
head(st$stability)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.