Package: kernR 0.10.0.9000

Max Moldovan

kernR: Kernel-Based Causal Distributional Testing

Kernel-based hypothesis tests for causal inference and distributional treatment effects. Implements backdoor-adjusted HSIC (bd-HSIC) for testing causal association, and doubly robust kernel statistics (DR-DATE, DR-DETT) for testing distributional treatment effects beyond mean shifts. Supports binary, continuous, and mixed treatments, hierarchical/nested data structures, and scales to large datasets via Nystrom approximation and random Fourier features. This package depends on 'PESTO' (GPL (>= 3)); kernR's own sources are released under the MIT licence, but the installed combination with 'PESTO' is a combined work subject to the terms of the GPL (>= 3).

Authors:Max Moldovan [aut, cre, cph]

kernR_0.10.0.9000.tar.gz
kernR_0.10.0.9000.zip(r-4.7-x86_64)kernR_0.10.0.9000.zip(r-4.7-arm64)kernR_0.10.0.9000.zip(r-4.6-x86_64)kernR_0.10.0.9000.zip(r-4.6-arm64)kernR_0.10.0.9000.zip(r-4.5-x86_64)
kernR_0.10.0.9000.tgz(r-4.6-x86_64)kernR_0.10.0.9000.tgz(r-4.6-arm64)kernR_0.10.0.9000.tgz(r-4.5-x86_64)kernR_0.10.0.9000.tgz(r-4.5-arm64)
kernR_0.10.0.9000.tar.gz(r-4.7-arm64)kernR_0.10.0.9000.tar.gz(r-4.7-x86_64)kernR_0.10.0.9000.tar.gz(r-4.6-arm64)kernR_0.10.0.9000.tar.gz(r-4.6-x86_64)
kernR_0.10.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
kernR/json (API)

# Install 'kernR' in R:
install.packages('kernR', repos = c('https://max578.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/max578/kernr/issues

Pkgdown/docs site:https://max578.github.io

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

openblascpp

4.89 score 52 exports 25 dependencies

Last updated from:3c691459b2 (on main). Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK290
linux-devel-x86_64OK271
source / vignettesOK378
linux-release-arm64OK274
linux-release-x86_64OK268
macos-release-arm64OK304
macos-release-x86_64OK514
macos-oldrel-arm64OK322
macos-oldrel-x86_64OK502
windows-devel-arm64OK378
windows-devel-x86_64OK342
windows-release-arm64OK380
windows-release-x86_64OK349
windows-oldrel-x86_64OK203
wasm-releaseOK283

Exports:aggregate_downscaleas_orchestra_manifestassess_overlapbd_hsic_testcalibration_suitecir_objectiveconcordance_testconcordance_test_nystromcoverage_testdist_regressiondr_date_scenariodr_date_testdr_dett_testeffective_sample_sizeestimate_density_ratioestimate_propensityfit_cmefit_density_ratiogaussian_scorehierarchical_testhsic_identifiabilityhsic_sensitivityhsic_testhsic_test_nystromis_kernR_abstentionjoint_coverage_testkernel_causal_testkernel_downscalekernel_matrixkernel_specksd_testksd_test_nystromlhs_designmechanism_consistency_testmmd_ppcmmd_testnumeric_scorenystrom_factororchestra_manifestpesto_ensembleplot_weightsposterior_sample_aggregatepredict_density_ratiorelative_entropyrelative_entropy_ensembleresolve_bandwidthrff_featuresselect_bandwidthtaci_testtidyverify_manifestweighted_hsic_stat

Dependencies:clicpp11data.tabledigestfarvergenericsggplot2gluegtableisobandlabelinglifecyclePESTOR6RColorBrewerRcppRcppArmadilloRcppEigenrlangS7scalesvctrsviridisLitewithryaml

A treatment that changes the spread and not the mean
Why | What | Do | A mean shift, which any method would find | A variance effect and nothing else | The effect on the treated, with imperfect overlap | The same question through a formula | The figure: what the mean cannot show | Read | Limits | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-04-10

Are these draws calibrated, and do the engines agree?
Why | What | Do | A sample that follows its target | The same sample, shifted | A target supplied as an unnormalised log density | Three sources that agree | One source departs | The figure: what the pairwise matrix is measuring | Read | Limits | What to read next | Reproduce

Last update: 2026-09-02
Started: 2026-06-02

Choosing a density-ratio backend
Why | What | Do | Which backends this build carries | A confounded design | The four ratios | The figure: the weights behind the diagnostic | The causal test under each backend | Read | Limits | When to reach for which | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

Did the management change shift the simulated distribution?
Why | What | Do | One calibration | Two forward runs from that one posterior | The scenario test | The null case | Restricting the test to named outputs | The figure: the ensembles the test is comparing | What the comparison refuses to do | Read | Limits | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

Does the treatment cause the outcome, or do they share a cause?
Why | What | Do | A linear causal effect | No causal effect, confounding only | A curved causal effect | The formula interface | The figure: two nulls, two verdicts | When the test declines to answer | Read | Limits | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-04-10

From a coarse grid to a paddock
Why | What | Do | Paired data: coarse climate to paddock yield | The figure: the downscaled surface against the field it came from | Bags of points: distribution regression | Choosing the outer kernel | No paired data: inverting a known aggregator | The three primitives side by side | Read | Limits | Notes on practice | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

Getting started with kernR
Why | What | Do | The kernel specification | The Gram matrix | Two samples, same distribution | Two samples, one shifted | Dependence a correlation cannot see | The figure: where the observed statistic sits | The three verdicts side by side | Read | Limits | What to read next | Reproduce

Last update: 2026-09-02
Started: 2026-04-10

Is the calibrated model right about more than the mean?
Why | What | Do | A held-out sample | A calibrated ensemble | An over-confident ensemble | A displaced ensemble | The package's own diagnostic | The figure: what each ensemble got wrong | The same check on a PESTO manifest | Read | Limits | Notes on practice | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

Multi-site trials and the permutation null
Why | What | Do | A synthetic eight-site panel | The same data, two permutation schemes | The same panel with the effect removed | The stratified breakdown | The figure: how the two nulls differ | Read | Limits | Choosing the scheme | Notes on practice | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

Scaling HSIC to large ensembles
Why | What | Do | Does the factorisation reproduce the kernel? | What it costs and what it saves | The figure: where the two curves separate | Read | Limits | Notes on practice | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

When plots sit inside farms
Why | What | Do | A synthetic twenty-farm trial | The decomposition | The three weighting conventions on the same data | The same trial with no treatment effect | The figure: where the signal sits | Read | Limits | What to read next | Reproduce

Last update: 2026-09-02
Started: 2026-04-10

Which parameters are worth calibrating?
Why | What | Do | A stand-in simulator | The design | One pass through the simulator, then the screen | The package's ranked diagnostic | The figure: the dependence the index is measuring | Handing the survivors to the calibration | Read | Limits | Notes on practice | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

Which parameters change the shape of the output distribution?
Why | What | Do | A simulator built to separate the two questions | The first-order scan | The figure: the distributions behind the index | Comparing against Sobol | Total-order indices, and a pure interaction | A near-additive design for contrast | An interval on the total-order index | The properly calibrated significance test | Read | Limits | Notes on practice | What to read next | References | Reproduce

Last update: 2026-09-02
Started: 2026-05-18

Readme and manuals

Help Manual

Help pageTopics
Aggregate-Likelihood Downscalingaggregate_downscale
Emit a kernR verdict as an orchestra manifestas_orchestra_manifest as_orchestra_manifest.kernel_test_result as_orchestra_manifest.mechanism_consistency_result
Assess Propensity Score Overlapassess_overlap
Backdoor-HSIC Test for Causal Associationbd_hsic_test
Calibration suite for a continuous predictioncalibration_suite calibration_suite.default
Objective Causal Influence Range (threshold-free)cir_objective
Kernel k-sample Concordance Testconcordance_test
Accelerated Kernel k-sample Concordance Test (Nystrom / RFF)concordance_test_nystrom
Coverage / Calibration Diagnostic for a Predictive Ensemblecoverage_test coverage_test.default coverage_test.pesto_ensemble coverage_test.pesto_ensemble_manifest
Kernel Distribution Regressiondist_regression
DR-DATE for Two PESTO Ensemble Scenariosdr_date_scenario
Doubly Robust Distributional Average Treatment Effect Test (DR-DATE)dr_date_test
Doubly Robust Distributional Effect on the Treated Test (DR-DETT)dr_dett_test
Compute Effective Sample Sizeeffective_sample_size
Estimate Density Ratios (backwards-compatible wrapper)estimate_density_ratio
Estimate Propensity Scoresestimate_propensity
Estimate Conditional Mean Embedding via Kernel Ridge Regressionfit_cme
Fit a Density-Ratio Modelfit_density_ratio
Score function for a multivariate normal targetgaussian_score
Hierarchical Kernel Causal Testhierarchical_test
HSIC-Based Identifiability Diagnostichsic_identifiability
HSIC-Based Distributional Sensitivity Indexhsic_sensitivity
HSIC Independence Testhsic_test
HSIC Independence Test via Low-Rank Factorisationhsic_test_nystrom
Did a kernR result decline to stand behind its own verdict?is_kernR_abstention
Joint (Multivariate) Calibration Diagnostic for a Predictive Ensemblejoint_coverage_test joint_coverage_test.default joint_coverage_test.pesto_ensemble joint_coverage_test.pesto_ensemble_manifest
Unified Kernel Causal Testkernel_causal_test
Kernel-Based Statistical Downscalingkernel_downscale
Compute a Kernel Matrixkernel_matrix
Create a Kernel Specificationkernel_spec
Kernel Stein Discrepancy Goodness-of-Fit Testksd_test
Accelerated Kernel Stein Discrepancy Goodness-of-Fit Test (Nystrom)ksd_test_nystrom
Latin-Hypercube Design Over Bounded Parameterslhs_design
Mechanism-consistency testmechanism_consistency_test
MMD Posterior-Predictive Checkmmd_ppc mmd_ppc.default mmd_ppc.pesto_ensemble mmd_ppc.pesto_ensemble_manifest
MMD Two-Sample Testmmd_test
Finite-difference score from a log-densitynumeric_score
Nystrom Low-Rank Kernel Factorisationnystrom_factor
The orchestra ensemble-manifest contract (kernR-side implementation)orchestra_manifest
PESTO Ensemble Manifest (Constructor)pesto_ensemble
Plot Weight Diagnosticsplot_weights
Plot an HSIC Identifiability Scanplot.hsic_identifiability
Plot HSIC-Sensitivity Indicesplot.hsic_sensitivity
Plot a Kernel Test Resultplot.kernel_test_result
Sample from the posterior of an aggregate-downscale fitposterior_sample_aggregate
Predict from a Fitted Density-Ratio Modelpredict_density_ratio
Predict Conditional Mean Embedding Weights at New Pointspredict.cme_fit
Predict from a Fitted Distribution Regression Modelpredict.dist_regression
Print a Conditional Mean Embedding Fitprint.cme_fit
Relative Entropy Between Two Gaussians (the ACI causal metric)relative_entropy
Relative Entropy Between Two Sample Ensembles (Gaussian approximation)relative_entropy_ensemble
Resolve Kernel Bandwidthresolve_bandwidth
Random Fourier Features for the RBF Kernelrff_features
Select Kernel Bandwidthselect_bandwidth
Tidy a kernR Test Result Into a One-Row-Per-Term Data Frametidy.kernel_test_result
Tidy a Mechanism-Consistency Resulttidy.mechanism_consistency_result
Verify an orchestra manifest's payload integrityverify_manifest
Weighted HSIC Statisticweighted_hsic_stat