Skip to contents

Workflow — start here

Primary functions for fitting, contrasting, classifying, and predicting

dkge()
Fit DKGE across multiple subjects
dkge_contrast()
Compute DKGE contrasts with cross-fitting
dkge_classify()
Cross-validated classification on DKGE effect patterns
dkge_infer()
Unified inference for DKGE contrasts
dkge_predict()
Predict DKGE contrasts for new subjects (out-of-sample)
dkge_freeze()
Freeze a DKGE fit into a compact model for prediction
dkge_bootstrap_analytic()
Analytic first-order bootstrap in the design space
dkge_bootstrap_projected()
Subject-level projection bootstrap in medoid space
dkge_bootstrap_qspace()
Multiplier bootstrap in the design space (q-space)

Advanced — model construction

Lower-level functions for custom workflows

dkge_fit()
Fit a Design-Kernel Group Embedding (DKGE) model
dkge_fit_from_input()
Fit DKGE from an input descriptor
dkge_fit_from_kernels()
Fit DKGE from precomputed subject effect kernels
dkge_weights()
Create a DKGE voxel-weight specification
dkge_weights_auto()
Default DKGE weight specification
dkge_weights_prior_mask()
Build prior weights from a mask
dkge_weights_prior_roi()
Build prior weights from ROI labels
design_kernel() dkge_design_kernel()
Build a flexible design-similarity kernel
dkge_mapper()
Create a pluggable DKGE anchor mapper for dense rendering
dkge_mapper_spec()
Specify a DKGE mapper strategy for the transport pipeline
dkge_transport_spec()
Transport specification helper
dkge_transport_contrasts_to_medoid()
Transport subject contrasts to a medoid parcellation
dkge_transport_loadings_to_medoid()
Transport component loadings to a medoid parcellation
dkge_transport_to_medoid_sinkhorn() dkge_transport_to_medoid_sinkhorn_cpp()
Transport cluster values to a medoid via entropic Sinkhorn OT
dkge_transport_to_voxels()
Transport DKGE quantities directly to voxel space
dkge_transport_service()
Construct a transport service
dkge_classification_spec()
Classification specification helper
dkge_inference_spec()
Inference specification helper
dkge_define_folds()
Define folds for K-fold cross-validation
dkge_subject()
Construct a DKGE subject record
dkge_data()
Bundle subject-level inputs for DKGE
dkge_prepare_transport()
Prepare subject-to-medoid transport operators for reuse
dkge_pipeline()
End-to-end DKGE workflow
dkge_loso_contrast()
Leave-one-subject-out DKGE contrast
dkge_analytic_loso()
Analytic LOSO contrast using eigenvalue perturbation
dkge_contrast_validated()
Dual-path DKGE contrasts with coverage diagnostics
dkge_cv_kernel_grid()
LOSO kernel grid search
dkge_cv_kernel_rank()
Combined kernel and rank selection via pre-screening and LOSO CV
dkge_cv_rank_loso()
LOSO cross-validation for rank selection
dkge_cv_train_latent_classifier()
Cross-fitted linear classifiers in the DKGE latent space
dkge_pooled_cov_q()
Pooled design-space covariance and Cholesky factor
dkge_predict_loadings()
Predict DKGE loadings for new subjects (out-of-sample)
dkge_predict_stream()
Streaming prediction for new subjects via a loader
dkge_predict_subjects()
Convenience prediction for subject collections
dkge_preprocess_blocks()
Preprocess multiple blocks into the DKGE training space
dkge_project_btil() dkge_project_block()
Project DKGE data into component space
dkge_project_blocks()
Project new blocks into DKGE score space
dkge_project_cluster()
Project a new cluster/voxel vector onto DKGE components
dkge_project_clusters()
Project multiple cluster/voxel vectors
dkge_project_clusters_to_latent()
Project subject clusters into the DKGE latent space
dkge_sim_toy()
Simulate toy DKGE datasets with known factorial structure
dkge_update_weights()
Refit a DKGE object with a new voxel-weight specification

Anchors and rendering

Functions for building and applying spatial anchor mappers

dkge_build_renderer()
Prepare reusable rendering objects for a fitted DKGE model
dkge_render_subject_values()
Render per-subject values to anchors and voxels
dkge_build_anchor_kernels()
Fold-aware anchor kernel construction
dkge_make_anchors()
Build or validate anchor coordinates in MNI space
dkge_anchor_aggregate()
Aggregate anchor fields with optional Laplacian smoothing
dkge_anchor_contrast_from_direction()
Build an anchor contrast from a feature-space direction
dkge_anchor_contrast_from_prototypes()
Build an anchor contrast from prototype feature sets
dkge_anchor_diagnostics()
Extract anchor diagnostics from a DKGE fit
dkge_anchor_fit()
Fit DKGE using feature-anchored subject kernels
dkge_anchor_graph()
Construct a kNN anchor graph and Laplacian
dkge_anchor_targets_from_directions()
Assemble anchor targets from feature-space directions
dkge_anchor_targets_from_prototypes()
Assemble anchor targets from prototype sets
dkge_anchor_to_voxel_apply()
Decode anchor values to voxel space
dkge_anchor_to_voxel_fit()
Fit a sparse anchor-to-voxel decoder
dkge_input_anchor()
Anchor-based DKGE input descriptor
fit_mapper()
Fit a mapper on subject/reference features
predict_mapper()
Apply a fitted mapper to new source values
apply_mapper()
Apply a fitted mapper to values

Extension points — S3 generics

Generics for integrating custom kernels, folds, and inputs

as_dkge_kernel()
Convert to a DKGE design kernel
as_dkge_folds()
Convert to DKGE fold assignments
dkge_run_service()
Run a dkge service object
dkge_contrast_service()
Construct a contrast service
dkge_inference_service()
Construct an inference service

Kernel and alignment utilities

Design kernels, K-Procrustes alignment, and kernel diagnostics

kernel_alignment() dkge_kernel_alignment()
Kernel alignment score
kernel_roots() dkge_kernel_roots()
Robust kernel roots
dkge_kernel_prescreen()
Kernel alignment pre-screening
dkge_k_orthonormalize()
Robust K-orthonormalization
dkge_procrustes_K()
K-orthogonal Procrustes alignment
dkge_align_bases_K()
Align multiple bases to a reference
dkge_consensus_basis_K()
Consensus K-orthonormal basis (K-Procrustes mean)
dkge_projector_K()
K-orthogonal projector onto span(T) in effect space
dkge_cosines_K()
Principal-angle cosines in the K-metric
dkge_jd_control()
Control parameters for DKGE joint diagonalisation
dkge_align_effects()
Align effect kernels across subjects with partial overlap
dkge_target_factor()
Target helper for a single factor
dkge_target_interaction()
Target helper for an interaction
dkge_targets()
Build classification targets from a DKGE fit

Cluster and CPCA utilities

Cluster-level projections and CPCA filtering

dkge_cpca_fit()
Fit DKGE with CPCA filtering
dkge_fit_cpca()
Fit DKGE bases on CPCA-filtered components
dkge_cpca_split_chat()
Split compressed covariance into design/residual parts (CPCA inside-span)
dkge_cluster_betas()
Compute cluster-level betas from neuroim2 objects
dkge_cluster_loadings()
Cluster-to-latent loadings for DKGE subjects
dkge_cluster_ts()
Aggregate voxel time series into cluster means
dkge_regress()
Multi-output regression on DKGE effects
dkge_transform_block()
Preprocess a subject block into DKGE training space
dkge_neuro_loader()
Build a streaming loader backed by neuroim2 objects

Visualization and diagnostics

Plotting and metric functions

dkge_plot_effect_loadings()
Effect-space loadings heatmap (K %*% U)
dkge_plot_info_anchor()
Anchor-level information plots
dkge_plot_scree()
DKGE scree plot with cumulative curve
dkge_plot_subject_contrib()
Subject weights and per-component energy heatmap
dkge_plot_subspace_stability()
Subspace stability via principal angles
dkge_plot_suite()
DKGE "Five Fundamentals" dashboard
dkge_diagnostics()
Summarise DKGE diagnostics
dkge_component_stats() dkge_write_component_stats()
Component-level consensus statistics
dkge_variance_explained()
Compute per-component variance explained
dkge_info_map_from_classifier()
Decoder-style information map from latent classifier weights
dkge_info_map_haufe()
Haufe-style encoding maps from latent classifiers
dkge_info_map_loco()
Group-LOCO anchor importance (zeroing proxy)
dkge_confusion()
Fold-wise confusion matrices for DKGE classification
dkge_paint_medoid_map()
Paint medoid cluster values back to a label volume
theme_dkge()
DKGE minimal theme for ggplot2 outputs

Internal building blocks

Low-level functions exposed for advanced use and testing

dkge_freedman_lane()
Freedman-Lane permutations for DKGE (scaffold)
dkge_signflip_maxT()
One-sample sign-flip max-T inference on transported subject maps
dkge_one_se()
One standard-error rule selection helper
dkge_component_stats() dkge_write_component_stats()
Component-level consensus statistics
dkge_write_group_map()
Write a group map as NIfTI using a medoid label image
dkge_clear_sinkhorn_cache()
Clear cached dual variables for Sinkhorn warm-starts
helmert_contrasts()
Helmert contrasts for a set of factors
sum_contrasts()
Sum-to-zero contrasts for a set of factors
dkpp_select_anchors()
Determinantal k-means++ (d-kpp) anchor selection
pairwise_sqdist_cpp()
Pairwise squared distances between two point sets (rows)
predict(<dkge>) predict(<dkge_model>)
Predict contrasts for new subjects using a DKGE fit
print(<dkge_contrasts>)
Print method for dkge_contrasts
print(<dkge_folds>)
Print method for dkge_folds
print(<dkge_inference>)
Print method for dkge_inference
as.data.frame(<dkge_inference>)
Convert DKGE inference results to a tidy data frame
as.matrix(<dkge_contrasts>)
Extract contrast values as matrix
dkge-info-maps
DKGE classifier information maps
dkge-latent-utils
DKGE latent-space utilities