Movatterモバイル変換


[0]ホーム

URL:


Title:Ensemble Sampler for Affine-Invariant MCMC
Version:3.2.0
Description:Provides ensemble samplers for affine-invariant Monte Carlo Markov Chain, which allow a faster convergence for badly scaled estimation problems. Two samplers are proposed: the 'differential.evolution' sampler from ter Braak and Vrugt (2008) <doi:10.1007/s11222-008-9104-9> and the 'stretch' sampler from Goodman and Weare (2010) <doi:10.2140/camcos.2010.5.65>.
License:GPL-2
URL:https://hugogruson.fr/mcmcensemble/,https://github.com/Bisaloo/mcmcensemble
BugReports:https://github.com/Bisaloo/mcmcensemble/issues
Depends:R (≥ 3.5)
Imports:future.apply, progressr
Suggests:bayesplot, coda, mockery, testthat (≥ 3.0.0), knitr,rmarkdown, mvtnorm
Encoding:UTF-8
RoxygenNote:7.3.2
Config/testthat/edition:3
Config/Needs/website:spacefillr
VignetteBuilder:knitr
NeedsCompilation:no
Packaged:2025-07-24 08:02:11 UTC; hugo
Author:Hugo GrusonORCID iD [cre, aut, cph], Sanda Dejanic [aut, cph], Andreas ScheideggerORCID iD [aut, cph]
Maintainer:Hugo Gruson <hugo.gruson+R@normalesup.org>
Repository:CRAN
Date/Publication:2025-07-24 08:40:17 UTC

MCMCEnsembleSampler

Description

This package implements a particle Monte Carlo Markov Chain samplerwith two different ways of creating proposals.

Author(s)

Maintainer: Hugo Grusonhugo.gruson+R@normalesup.org (ORCID) [copyright holder]

Authors:

See Also

Useful links:


MCMC ensemble sampler

Description

Ensemble Markov Chain Monte Carlo sampler with different strategies togenerate proposals. Either thestretch move as proposed by Goodman andWeare (2010), or adifferential evolution jump move similar to Braak andVrugt (2008).

Usage

MCMCEnsemble(  f,  inits,  max.iter,  n.walkers = 10 * ncol(inits),  method = c("stretch", "differential.evolution"),  coda = FALSE,  ...)

Arguments

f

function that returns a single scalar value proportional to the logprobability density to sample from.

inits

A matrix (or data.frame) containing the starting values for thewalkers. Each column is a variable to estimate and each row is a walker

max.iter

maximum number of function evaluations

n.walkers

number of walkers (ensemble size). An integer greater thanmax(3, d+1) for stretch move and greater thanmax(4, d+2) fordifferential evolution whered == ncol(inits).

method

method for proposal generation, either"stretch", or"differential.evolution". This argument will be saved as an attributein the output (see examples).

coda

logical. Should the samples be returned ascoda::mcmc.listobject? (defaults toFALSE)

...

further arguments passed tof

Value

In both cases, there is an additional attribute (accessible viaattr(res, "ensemble.sampler")) recording which ensemble sampling algorithmwas used.

References

Examples

## a log-pdf to sample fromp.log <- function(x) {    B <- 0.03                              # controls 'bananacity'    -x[1]^2/200 - 1/2*(x[2]+B*x[1]^2-100*B)^2}## set options and starting pointn_walkers <- 10unif_inits <- data.frame(  "a" = runif(n_walkers, 0, 1),  "b" = runif(n_walkers, 0, 1))## use stretch moveres1 <- MCMCEnsemble(p.log, inits = unif_inits,                     max.iter = 150, n.walkers = n_walkers,                     method = "stretch")attr(res1, "ensemble.sampler")str(res1)## use stretch move, return samples as 'coda' objectres2 <- MCMCEnsemble(p.log, inits = unif_inits,                     max.iter = 150, n.walkers = n_walkers,                     method = "stretch", coda = TRUE)attr(res2, "ensemble.sampler")summary(res2$samples)plot(res2$samples)## use different evolution move, return samples as 'coda' objectres3 <- MCMCEnsemble(p.log, inits = unif_inits,                     max.iter = 150, n.walkers = n_walkers,                     method = "differential.evolution", coda = TRUE)attr(res3, "ensemble.sampler")summary(res3$samples)plot(res3$samples)

[8]ページ先頭

©2009-2025 Movatter.jp