Permutation null for banded-ridge prediction accuracy
Source:R/banded_ridge_weights.R
banded_ridge_null.RdTests the held-out accuracy of every response against a null in which the predicted series is shifted in time against the observed one. Shifting keeps the autocorrelation of both series, which a row shuffle would destroy, so the null is appropriate for continuous time series. No model is refit.
Arguments
- model
A `banded_ridge_model` built with `return_predictions = TRUE`.
- result
The result of `run_banded_ridge(model)`.
- n_perm
Number of permutations.
- metric
`"correlation"` (default) or `"r2"`.
- strategy
`"circular_shift"` (default) or `"block_shuffle"`.
- block_size
Block length for `"block_shuffle"`; defaults to `floor(sqrt(n))`.
- min_shift
Smallest circular shift, in rows. Set it beyond the autocorrelation length of the data.
- seed
Integer seed; the same permutations are applied to every response.
Value
A data frame with one row per response: `voxel_index`, the observed `statistic`, the permutation `p_value` (one-sided, observed value counted in the null), and `z`, the statistic standardized by the null.