lss_design(diagnostics = TRUE) input-design rank/conditioning,
trial and voxel mappings, and nonfinite-beta summaries.fit_oasis_grid() HRF candidates using joint least-squares profile
residuals with voxel intercepts; use the production event builder for both
simulation and selection. Preserve fractional onsets and sample times.
Compare normalized HRF shapes on their actual time grid, incorporate event
amplitudes in beta truth, and leave unavailable beta correlations as NA.glmsingle() implements GLMsingle (Prince et al., 2022): an ON-OFF model,
a per-voxel HRF chosen from GLMsingle's 20-HRF library, GLMdenoise noise
regressors chosen by cross-validation, and voxel-wise fractional ridge
regression chosen by cross-validation over repeated conditions.1ab54a6) is tested on 11
scenarios: all HRF, noise-component and ridge-fraction choices match, and
betas agree to single-precision accuracy.nuisance_in_denoise, cv_zero_variance); the alternative
argument values reproduce GLMsingle.fit_hrf, denoise,
max_pcs, n_pcs, pc_stop, noise_pool_*, ridge, ridge_*,
cv_folds, sessions, nuisance, percent_signal); ?glmsingle maps
each to its GLMsingle option.glmsingle_design() fits from an fmridesign event model;
glmsingle_hrf() and glmsingle_hrf_library() return GLMsingle's HRFs.vignette("glmsingle").Use CRAN albersdown (>= 2.1.0) and its albers_vignette() output
format; theme assets are embedded from the installed package.
Recalibrated fmrilss, oasis_method and voxel-wise-hrf for fmrihrf's
corrected SPMG HRFs (smaller raw scale and a realistic undershoot). Designs
now use unit-peak HRFs, and checks that were tied to the old kernel are
relative or computed.
r_optimized, cpp_optimized, cpp) now
build the n x T LSS weight matrix from the residualized trial design and
compute every trial beta with one matrix product. The data matrix is no
longer residualized or copied, the per-voxel R loop is gone, and
cpp_optimized only splits voxels across OpenMP threads when the linked
BLAS is single-threaded. Default lss() on 600 scans x 20,000 voxels with
150 trials: 1.9 s -> 0.07 s.lss() on the
same problem: 4.9 s -> 0.7 s.Y.lss(trial_groups = ) fits LSS-N (Turner et al., 2012): one summed
"other trials" regressor per condition, the model used by Nilearn's and
NiBetaSeries' beta series.
lss(ridge = ) adds a fractional ridge penalty to each trial model (the
OASIS ridge_mode = "fractional" convention), composable with
trial_groups and prewhitening. In rapid designs with overlapping trials
it lowers beta RMSE substantially (about a third in the benchmark) without
changing pattern correlations.
prewhiten = list(pooling = "voxel") and pooling = "parcel" now work
with a shared design for r_optimized, cpp_optimized and cpp: each
whitening operator gets its own filtered design. Voxel pooling bins voxels
by residual autocorrelation (voxel_bins, default 50) and refits an AR
model per bin, as in Nilearn's AR(1) GLM.
New lss_rank1(): the rank-1 GLM of Pedregosa et al. (2015), which
learns one HRF per voxel (in any fmrihrf basis) jointly with per-trial
amplitudes, as least-squares-separate (model = "separate", R1-GLMS,
optionally with LSS-N trial_groups) or least-squares-all
(model = "joint", R1-GLM). It is fitted by exact alternating least
squares on K x K Gram blocks, which is monotone, parallel over voxels and,
in benchmarks, reaches the same optimum as the paper's L-BFGS approach
(also available as solver = "lbfgs") 3-200x faster. The learned HRFs
are returned as a VoxelHRF for lss_with_hrf() on new data. See
vignette("rank1_hrf").
prewhiten$residual_model defaults to "aggregate" (confounds plus one
summed regressor per trial group or basis function); "full" restores the
previous behaviour and is implied by a user-supplied residual-bias
correction; "corrected" fits the full model with fmriAR's bias
correction, built automatically (least biased; global/run pooling only).
The new vignette("prewhitening") explains the trade-offs.bench/python_comparison/ compares fmrilss with Nilearn (per-trial
run_glm, OLS and AR(1)) and NumPy LSS implementations on a shared
simulation: fmrilss reproduces the Python OLS estimates to < 5e-13, is
~200x faster than the Nilearn per-trial loop at 20k voxels, and its
voxel-adaptive AR(1) matches Nilearn's AR(1) accuracy.prewhiten parameter in lss() function provides comprehensive AR/ARMA noise modeling
p = "auto"pooling = "voxel"pooling = "run" with runs parameterpooling = "parcel" with parcels parametermethod = "arma" for complex noise structuresprewhiten_options() now forwards fmriAR 0.3.3's opt-in residual-
autocovariance bias-correction controls: design, acvf_correction, and
correction_max_lag.fmriAR_plan in the result's
whiten_plan attribute.lss() recognizes an unmodified multi-basis fmridesign design matrix and
returns the same canonical trial-major rows as lss_design().lss_design() supports every lss() estimator for one-basis designs and
gives an actionable error when a non-OASIS estimator is used with a
multi-basis model.create_lwu_grid() output now composes directly with
sbhm_build(library_spec = list(..., pgrid = grid)).oasis$whiten option is deprecated and ignored. Use the top-level
prewhiten argument and prewhiten_options() instead.mixed_solve() as documented; each
response column is fitted independently.getting_started.Rmd: New section on temporal autocorrelationoasis_method.Rmd: Advanced prewhitening demonstrationsexamples/prewhitening_examples.Rtest-fmriAR-integration.R)fmriAR (>= 0.3.3) to Imports.fmriAR package.estimate_voxel_hrf() and lss_with_hrf().