Estimate a design-free AR(p) whitener from a run
estimate_ar_whitener.RdEstimates an autoregressive whitener for a single NeuroVec run using the
global mean (optionally restricted to WM) and Yule–Walker AR fitting.
Returns the inverse Cholesky Q, the covariance Sigma, and AR
coefficients phi.
Arguments
- nv_run
A
neuroim2::NeuroVec(single run) with dimensions V x T.- wm_mask
Optional
NeuroVolto restrict the mean to WM voxels.- p
Integer AR order (default 1). Use 0 to skip AR modeling.
Value
A list with components Q (inverse Cholesky), Sigma (covariance),
and phi (AR coefficients of length p).
Details
The time series is formed as the mean across voxels, optionally within a
provided white-matter mask. It is standardized, and AR(p) coefficients are
estimated via stats::ar.yw. The implied Toeplitz covariance Sigma is
regularized to positive definiteness (via a ridge and Matrix::nearPD if
needed). The whitener Q = chol(Sigma)^{-1} is returned for use in the
row metric. If p = 0, an identity whitener is returned.
See also
estimate_ar_whitener_parcel() for parcel-level AR whitening
Other temporal metrics:
build_temporal_metric(),
build_temporal_metric_parcel(),
estimate_ar_whitener_parcel(),
make_frame_weights(),
make_temporal_penalty()
Examples
# \donttest{
nv_run <- neuroim2::simulate_fmri(mask, n_time = 50, seed = 1)
#> Error: object 'mask' not found
arw <- estimate_ar_whitener(nv_run, p = 1L)
#> Error: object 'nv_run' not found
# }