Runs bootstrap or permutation inference for `muscal` fits that expose a standard refit contract through `fit_spec$refit`. This keeps resampling logic generic across method families while still allowing each method to define its own data reconstruction and null-generation strategy.
Arguments
- object
A fitted `muscal` model.
- method
One of `"bootstrap"` or `"permutation"`.
- statistic
One of `"sdev"` or `"loadings"`. Ignored if `statistic_fn` is supplied.
- statistic_fn
Optional extractor `function(fit)`, used for custom statistics. For permutation inference this must return a numeric vector.
- nrep
Number of resampling replicates.
- alpha
Tail probability used for bootstrap intervals and permutation reference quantiles.
- seed
Optional RNG seed for reproducible resampling.
- alternative
Alternative hypothesis for permutation p-values.
- refit
Optional refit specification overriding `object$fit_spec$refit`.
- verbose
Logical; if `TRUE`, emit progress and failure counts.
- ...
Reserved for future extensions.