Package: gpumetropolis 0.7.0

gpumetropolis: GPU-Portable Vendor-Agnostic Metropolis-Hastings Sampler

A generic random-walk Metropolis-Hastings sampler for Markov chain Monte Carlo. The user declares a model by writing its log-likelihood and log-prior as one-sided formulas; the package compiles them to a stack-machine bytecode that a single portable kernel interprets, so the same model runs on the CPU and on the GPU from one source. The sampler advances many independent chains in one batched pass. A distributional equivalence harness based on the two-sample Kolmogorov-Smirnov test and the split R-hat statistic of Gelman and Rubin (1992) <doi:10.1214/ss/1177011136> checks the GPU output against the CPU output. Dispatching the kernel to a GPU helps when many chains are run or when the log-density is expensive to evaluate over a large data set, and does not help for small models run with few chains.

Authors:Pedro Carvalho Brom [aut, cre, cph]

gpumetropolis_0.7.0.tar.gz
gpumetropolis_0.7.0.zip(r-4.7-x86_64)gpumetropolis_0.7.0.zip(r-4.7-arm64)gpumetropolis_0.7.0.zip(r-4.6-x86_64)gpumetropolis_0.7.0.zip(r-4.6-arm64)gpumetropolis_0.7.0.zip(r-4.5-x86_64)
gpumetropolis_0.7.0.tgz(r-4.6-x86_64)gpumetropolis_0.7.0.tgz(r-4.6-arm64)gpumetropolis_0.7.0.tgz(r-4.5-x86_64)gpumetropolis_0.7.0.tgz(r-4.5-arm64)
gpumetropolis_0.7.0.tar.gz(r-4.7-arm64)gpumetropolis_0.7.0.tar.gz(r-4.7-x86_64)gpumetropolis_0.7.0.tar.gz(r-4.6-arm64)gpumetropolis_0.7.0.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
gpumetropolis/json (API)

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

Bug tracker:https://github.com/pcbrom/gpumetropolis/issues

On CRAN:

Conda:

rustcargo

4.64 score 1 stars 29 exports 0 dependencies

Last updated from:261aae0985. Checks:14 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK377
linux-devel-x86_64OK423
source / vignettesOK644
linux-release-arm64OK416
linux-release-x86_64OK374
macos-release-arm64OK443
macos-release-x86_64OK986
macos-oldrel-arm64OK401
macos-oldrel-x86_64OK1068
windows-devel-arm64OK781
windows-devel-x86_64OK752
windows-release-arm64OK787
windows-release-x86_64OK800
windows-oldrel-x86_64OK770
wasm-releaseFAIL221

Exports:essgaussian_mean_posteriorgpu_metropolisgpum_bayes_factorgpum_copulagpum_crlbgpum_density_comparegpum_diagnosegpum_evidencegpum_fit_cataloggpum_hypothesisgpum_lfogpum_lmgpum_loogpum_modelgpum_pairsgpum_ppcgpum_regiongpum_ropegpum_surfacegpum_ts_modelgpum_waichdikendall_tauks_equivalencemarginal_cdfmetropolis_gaussian_meanrhattail_dependence

Dependencies:

A complete case on real data: the Old Faithful geyser
Part 1: a regular regression | Declaring and fitting the model | Checking convergence | The joint posterior | The Cramer-Rao reference | Deciding the relationship | Weighing the evidence for a slope | Head-to-head against the established packages | Part 2: an irregular mixture | The bimodal target | Why the random walk fails, and the Cramer-Rao refusal | Parallel tempering recovers both components | Choosing between one component and two | Observed against the generated distribution | What each tool contributed

Last update: 2026-08-10
Started: 2026-06-29

Extreme sea levels on real data: return levels at Port Pirie
The Gumbel model | The joint posterior and the information bound | The return level, with its uncertainty | A design question as a hypothesis | Is the extreme-value law worth it? Gumbel against the Normal | Observed against the generated distribution | Head-to-head against the established packages | The shape parameter, and a limit of the scalar model | What this case exercised

Last update: 2026-08-10
Started: 2026-06-29

Model comparison on real data: fuel economy in mtcars
The simple model and its fit | Reading the posterior | Does horsepower add anything? Predictive comparison | Weighing the evidence for horsepower | Observed against the generated distribution | Head-to-head against the established packages | What this case exercised

Last update: 2026-08-10
Started: 2026-06-29

Case study: automatic marginal selection and the full Sklar workflow
1. One column, many candidate shapes | 2. Visual inspection | 3. The fitted CDF is the transform to the unit square | 4. The full Sklar workflow on two columns | 5. Where this stops

Last update: 2026-08-05
Started: 2026-08-05

Case study: copula dependence between temperature and ozone
1. Pseudo-observations, the dependence stripped of the margins | 2. Fitting with automatic family selection | 3. Reading the dependence | 4. Visual inspection | 5. Against the classical estimator | 6. Forcing the eye's hypothesis, and seeing it rejected | 7. Where this stops | References

Last update: 2026-08-05
Started: 2026-08-05

Case study: the Nile flow, Bayesian inference beyond i.i.d.
1. The three ways data stop being i.i.d. | 2. Regime 2: a stationary AR(1) for the flow | 3. Regime 3: the dam as a covariate, dependence plus heterogeneity | 4. Model comparison that respects time | 5. Observed against generated, in time | 6. Where this stops, honestly | References

Last update: 2026-07-16
Started: 2026-07-16

Bimodal extreme-value data: Gumbel mixture with parallel tempering
A real dataset: Oxford annual maximum temperatures | A single Gumbel as the Tier A candidate | Why a Gumbel mixture on Oxford is harder than it looks | A two-regime simulation, the recovery story | The mixture model in the DSL | Parallel tempering on the mixture posterior | Settling the choice by WAIC | Identifiability post-processing | Posterior predictive check | Fair comparison with current practice | Single Gumbel: matched by an established MLE pipeline | Two-component Gumbel mixture: no standard one-liner in R | What is manual today and what becomes automatic in v0.6.0 | References

Last update: 2026-06-29
Started: 2026-06-15

Differential Evolution on a correlated posterior, with a Cramer-Rao reference
The model | Random walk against Differential Evolution | The Cramer-Rao reference | Consistency and the n to the minus one-half rate | Honest positioning

Last update: 2026-06-29
Started: 2026-06-29

Differential Evolution on a curved target (the banana)
The model | The failure mode of diagonal random-walk Metropolis | The fix: Differential Evolution | Reading the result | Honest positioning

Last update: 2026-06-29
Started: 2026-06-29

Getting started with gpumetropolis
Declaring a model | Running the sampler | The fit object | Convergence diagnostics | One source, several backends | A model with more than one parameter | When the GPU helps

Last update: 2026-06-29
Started: 2026-05-18

Parallel tempering for bimodal posteriors (M2)
The model | The failure mode of plain random-walk Metropolis | Parallel tempering | Inspecting the cold chain directly | Tuning notes for parallel tempering | What the focused re-run shows in numbers | When to reach for parallel tempering

Last update: 2026-06-29
Started: 2026-06-15

Readme and manuals

Help Manual

Help pageTopics
Effective sample sizeess
Closed-form posterior of the Gaussian meangaussian_mean_posterior
Run the GPU-portable batched Metropolis samplergpu_metropolis
Bayes factor between two models by thermodynamic integrationgpum_bayes_factor
Fit a bivariate copula to two-column datagpum_copula
Observed Fisher information and Cramer-Rao bound for a fitgpum_crlb
Compare an observed distribution with generated ones on one plotgpum_density_compare
One-call diagnostic: convergence stats, plots and verdict.gpum_diagnose
Log marginal likelihood by thermodynamic integrationgpum_evidence
Automatic marginal distribution selection for one columngpum_fit_catalog
Posterior probability of a hypothesis on one parametergpum_hypothesis
Exact leave-future-out cross-validation for dependent datagpum_lfo
Declare a conjugate Gaussian linear modelgpum_lm
Pareto-smoothed importance-sampling leave-one-out (PSIS-LOO)gpum_loo
Declare a model for the GPU-portable Metropolis samplergpum_model
Pairs plot of the joint posteriorgpum_pairs
Posterior predictive sample from a fitgpum_ppc
Credible region of a parameter pairgpum_region
ROPE and HDI decision on one parametergpum_rope
Posterior density surface of a parameter pairgpum_surface
Declare a Markov (time-series) model by conditional factorisationgpum_ts_model
Widely applicable information criterion (WAIC)gpum_waic
Highest posterior density intervalhdi
Posterior Kendall's tau of a fitted copulakendall_tau
Distributional equivalence by the two-sample Kolmogorov-Smirnov testks_equivalence
Fitted cumulative distribution of the selected marginalmarginal_cdf
Batched random-walk Metropolis sampler for a Gaussian meanmetropolis_gaussian_mean
Visual inspection of a fitted marginal catalogueplot.gpum_catalog
Visual inspection of a fitted bivariate copulaplot.gpum_copula
Split R-hat convergence diagnosticrhat
Posterior tail-dependence coefficients of a fitted copulatail_dependence