Package: proxymix 0.15.1

proxymix: KL-Optimal Gaussian Mixture Proxies for Arbitrary Target Densities

Fits multivariate Gaussian-mixture proxies that are Kullback-Leibler optimal to user-supplied target densities on real Euclidean space. Three fitting regimes are unified under one verb: (i) closed-form moment matching for a single component, (ii) classical expectation-maximisation when independent samples are available, and (iii) importance-sampled KLD-EM when the target can be evaluated point-wise but not (cheaply) sampled. Closed-form Gaussian-mixture operators (density, sampling, marginalisation, conditioning, divergence) round out the toolkit. The conditioning operator drives multiple imputation of data missing at random, covering the multimodal and heteroscedastic cases a single-Gaussian model cannot represent. Implements the regime hierarchy of Hoek and Elliott (2024) <doi:10.1080/07362994.2024.2372605>.

Authors:Max Moldovan [aut, cre]

proxymix_0.15.1.tar.gz
proxymix_0.15.1.zip(r-4.7-any)proxymix_0.15.1.zip(r-4.6-any)proxymix_0.15.1.zip(r-4.5-any)
proxymix_0.15.1.tgz(r-4.6-any)proxymix_0.15.1.tgz(r-4.5-any)
proxymix_0.15.1.tar.gz(r-4.7-any)proxymix_0.15.1.tar.gz(r-4.6-any)
proxymix_0.15.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
proxymix/json (API)

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

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

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

On CRAN:

Conda:

4.56 score 99 exports 9 dependencies

Last updated from:769b04e02a (on main). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK282
source / vignettesOK344
linux-release-x86_64OK247
macos-release-arm64OK155
macos-oldrel-arm64OK172
windows-develOK226
windows-releaseOK211
windows-oldrelOK226
wasm-releaseOK172

Exports:as_midsbanana_targetbic_aiccensoreddgmmdonut_targetepanechnikov_targetess_summaryess_tracefit_em_samplesfit_kld_emfit_moment_matchfit_proxymixfit_upliftfrom_kdefrom_objectivegmmgmm_affinegmm_aggregategmm_anneal_pathgmm_canonicalisegmm_cf_meangmm_cf_tail_probgmm_cf_variancegmm_completegmm_conditional_entropygmm_conditionalisegmm_convolvegmm_counterfactualgmm_counterfactual_lawgmm_covgmm_covariancesgmm_dimgmm_divergencegmm_entropygmm_eos_testgmm_evidencegmm_filtergmm_fitgmm_fit_ensemblegmm_fit_qualitygmm_imputationgmm_imputegmm_independence_graphgmm_intervenegmm_kldgmm_marginalisegmm_meangmm_meansgmm_missinggmm_mixgmm_modesgmm_mutual_informationgmm_n_componentsgmm_observegmm_productgmm_reducegmm_targetgmm_target_from_posteriorgmm_target_from_samplesgmm_weightshellinger_mcinit_kmeansinit_moment_seedinit_randominit_warm_startis_mvnis_mvtis_proposalis_uniformkld_tracemarmaxent_targetmixture_targetmnarmulti_start_best_ofpgmmproposal_mvnproposal_mvtproposal_uniformproxy_cateproxy_confounding_gapproxy_decideproxy_fmiproxy_functional_ciproxy_identification_reportproxy_mnar_sensitivityproxy_overlapproxy_policy_valueproxy_poolproxy_predictproxy_regime_segmentsproxy_retrospective_upliftproxy_upliftqgmmrgmmselect_Nuplift_identificationuplift_model

Dependencies:BHclidata.tablemvnfastRcppRcppArmadillorlangS7withr

Affine-Gaussian operator calculus on a Gaussian mixture
Why an operator calculus | A worked example | Pushforward through a linear sensor | Bayesian update on a noisy linear observation | Kalman parity check | Aggregation through a coarsening matrix | Missing-data conditioning | Filtering over time -- the Kalman filter as a special case | Bounding the filter -- mixture reduction | A bounded filter in one call -- gmm_filter() | Composition rules | When to not use the operator calculus | Comparison to a Gaussian-process latent | References

Last update: 2026-07-05
Started: 2026-05-14

From KDE: compressing a kernel density estimate into a Gaussian-mixture proxy
Why a from_kde() constructor | Recovering a known mixture | Quality of the importance-sampled fit | Bandwidth sensitivity | Visualising the compression | Scope and limits (v0.2) | When to prefer fit_proxymix(regime = "sample") instead | References

Last update: 2026-07-05
Started: 2026-05-14

KLD-EM on three density shapes
Banana | Donut | Three-mixture | Bounded support | Summary | Reference

Last update: 2026-07-05
Started: 2026-05-14

One mixture, many methods
Regression -- from lm() to a conditioned mixture | Kernel regression -- from Nadaraya--Watson to a conditioned KDE | Clustering -- from kmeans() to the mixture components | Principal components -- from prcomp() to the fitted covariance | Penalised regression -- ridge as a covariance ridge | A few more, in one line each | Summary | When to reach for the specialised tool | References

Last update: 2026-07-05
Started: 2026-06-17

Quickstart
A target you cannot sample from | Fit a Gaussian-mixture proxy | Overlay the proxy on the target | Closed-form mixture operations | Where to next | Reference

Last update: 2026-07-05
Started: 2026-05-14

Three regimes: moment, sample, and KLD-EM
Regime (i): closed-form moment matching | Regime (ii): classical EM on samples | Regime (iii): importance-sampled KLD-EM | Side-by-side overlay | A sanity check: (i) and (iii) agree at N = 1 | Reference

Last update: 2026-07-05
Started: 2026-05-14

Compressing a Bayesian posterior you can evaluate but not sample
A real unnormalised posterior | Fit the proxy | The evidence, with an independent check | Closed-form reads off the proxy | Error bars on the proxy itself | When to use this, and when not to | References

Last update: 2026-07-05
Started: 2026-07-05

Entropy diagnostics with proxymix
The closed-form spine | Renyi-2 entropy | Shannon entropy, bracketed | Cauchy--Schwarz divergence | Mutual information and predictive entropy | When to use which | Deterministic annealing and phase transitions | Maximum-entropy targets | Selecting a component count with ICL | Dependency structure of a mixture | References

Last update: 2026-07-05
Started: 2026-06-17

Imputing missing data with a mixture
Imputation is conditioning | A two-cluster example | Impute, then look at the shape | Pooling an estimand | Scope

Last update: 2026-07-05
Started: 2026-06-20

Mapping the optima of an objective
An objective is a density you can evaluate but not sample | A bimodal objective in one dimension | Four minima at once: Himmelblau | Notes on use | References

Last update: 2026-07-05
Started: 2026-06-19

Missing data that depends on the missing value
Imputation is conditioning on a gate | A value-dependent mechanism biases the ordinary fit | The slope is a sensitivity parameter | Censoring is the exact, identifiable case | Scope and references

Last update: 2026-07-05
Started: 2026-06-21

Testing the last observation for instability
The end-of-sample question | The statistic | A worked example | Robustness to non-Gaussian noise | Scope | Reference

Last update: 2026-07-05
Started: 2026-06-21

Readme and manuals

Help Manual

Help pageTopics
Convert imputations to a mice multiply-imputed datasetas_mids
Plot a fitted Gaussian-mixture proxyautoplot.gmm_fit
Banana-shaped 2-D targetbanana_target
Information criteria: BIC, AIC, and ICLbic_aic
Density of a Gaussian mixturedgmm
Donut-shaped 2-D targetdonut_target
Compact-support Epanechnikov targetepanechnikov_target
Summary of importance-sampling diagnosticsess_summary
Effective sample size of the importance-sampling weightsess_trace
Classical EM fit on samplesfit_em_samples
Importance-sampled KLD-EM fit (regime iii)fit_kld_em
Closed-form moment-matching fitfit_moment_match
Fit a Gaussian-mixture proxy to a target densityfit_proxymix
Fit an uplift / next-best-action model from a data framefit_uplift
Compile a kernel-density estimate into a Gaussian-mixture proxyfrom_kde
Map the optima of an objective with a Gaussian-mixture proxyfrom_objective
Glance at a fitted Gaussian-mixture proxyglance.gmm_fit
A Gaussian mixturegmm
Affine pushforward of a Gaussian mixturegmm_affine
Aggregation pushforward of a Gaussian mixturegmm_aggregate
Phase-transition component discovery by deterministic annealinggmm_anneal_path
Canonicalise the component ordering of a Gaussian mixturegmm_canonicalise
The identified counterfactual meangmm_cf_mean
Refused: a tail probability of an individual counterfactual lawgmm_cf_tail_prob
Refused: the variance of an individual counterfactual lawgmm_cf_variance
Extract completed datasets from a 'gmm_imputation'gmm_complete
Conditional predictive entropy of a Gaussian mixturegmm_conditional_entropy
Conditional of a Gaussian mixturegmm_conditionalise
Convolution of two independent Gaussian mixturesgmm_convolve
Counterfactual law of one unit (abduction, action, prediction)gmm_counterfactual
A per-unit counterfactual lawgmm_counterfactual_law
Dimension of a Gaussian mixturegmm_dim
Divergence between two Gaussian mixturesgmm_divergence
Differential entropy of a Gaussian mixturegmm_entropy
End-of-sample instability test on a Gaussian state-space filtergmm_eos_test
Estimate the target's normalising constant from a fitted proxygmm_evidence
Bounded Gaussian-sum filtering over an observation seriesgmm_filter
A fitted Gaussian-mixture proxygmm_fit
Bootstrap ensemble of a fitted proxygmm_fit_ensemble
The quality certificate of a fit or derived mixturegmm_fit_quality
A Gaussian-mixture multiple-imputation resultgmm_imputation
Multiple imputation by Gaussian-mixture conditioninggmm_impute
Conditional-independence (Gaussian graphical model) structure of a mixturegmm_independence_graph
Interventional law of a Gaussian mixture (the do-operator)gmm_intervene
Kullback-Leibler divergence between two Gaussian mixturesgmm_kld
Marginal of a Gaussian mixturegmm_marginalise
Mean and covariance of a Gaussian mixturegmm_cov gmm_mean
Condition a Gaussian mixture on the exact values of some coordinatesgmm_missing
Mix Gaussian mixtures into one mixturegmm_mix
Modes of a Gaussian mixturegmm_modes
Cauchy-Schwarz mutual information between two coordinate blocksgmm_mutual_information
Number of components in a Gaussian mixturegmm_n_components
Bayesian update of a Gaussian mixture on a noisy linear observationgmm_observe
Pointwise product of two Gaussian mixturesgmm_product
Reduce a Gaussian mixture to fewer componentsgmm_reduce
A target density on R^pgmm_target
Compile an unnormalised Bayesian posterior into a 'gmm_target'gmm_target_from_posterior gmm_target_from_posterior.default gmm_target_from_posterior.function
Build a target from samples alonegmm_target_from_samples
Component parameters of a Gaussian mixturegmm_covariances gmm_means gmm_weights
Monte-Carlo Hellinger distance between a fit and its targethellinger_mc
k-means initialisationinit_kmeans
Moment-seed initialisationinit_moment_seed
Random initialisationinit_random
Warm-start initialisation from an existing fitinit_warm_start
Multivariate-normal proposalis_mvn
Multivariate-t proposalis_mvt
An importance-sampling proposalis_proposal
Uniform-on-a-box proposalis_uniform
Per-iteration KLD trace of a fitkld_trace
Maximum-entropy target under moment and support constraintsmaxent_target
Missingness mechanisms for multiple imputationcensored mar mechanism mnar
Three-component Gaussian-mixture targetmixture_target
Multi-start best-of wrappermulti_start_best_of
Distribution and quantile functions of a one-dimensional mixturepgmm qgmm
Preferred names for the importance-proposal constructorsproposal_mvn proposal_mvt proposal_uniform
Heterogeneous treatment effects (CATE / uplift)proxy_cate
Confounding gap: the sensitivity of the effect to the latent regimeproxy_confounding_gap
Optimal action and expected incremental value per unitproxy_decide
Fraction of missing information for a column meanproxy_fmi
Percentile interval for any functional of a fitted proxyproxy_functional_ci
The identification report (an executive one-pager)proxy_identification_report
Missing-not-at-random sensitivity analysis for a coordinate meanproxy_mnar_sensitivity
Per-unit overlap / positivity diagnosticproxy_overlap
Off-line value of a targeting policyproxy_policy_value
Pool a column mean across imputationsproxy_pool
Predicted outcome under a treatment (the seeing rung)proxy_predict
The fitted regimes as an interpretable segment tableproxy_regime_segments
Retrospective (counterfactual-mean) uplift for observed unitsproxy_retrospective_uplift
Uplift (alias of 'proxy_cate()' for a binary treatment)proxy_uplift
Sample from a Gaussian mixturergmm
Select the number of mixture componentsselect_N
Tidy a Gaussian mixture into a component tabletidy.gmm
Identification-report objectuplift_identification
A fitted uplift / next-best-action modeluplift_model