sampler.AdaptiveMH {BayesFluxR}R Documentation

Adaptive Metropolis Hastings as introduced in

Description

Haario, H., Saksman, E., & Tamminen, J. (2001). An adaptive Metropolis algorithm. Bernoulli, 223-242.

Usage

sampler.AdaptiveMH(bnn, t0, sd, eps = 1e-06)

Arguments

bnn

BNN obtained using BNN

t0

Number of iterators before covariance adaptation will be started. Also the lookback period for covariance adaptation.

sd

Tuning parameter; See paper

eps

Used for numerical reasons. Increase this if pos-def-error thrown.

Value

a list with 'juliavar', 'juliacode', and all given arguments

Examples

## Not run: 
  ## Needs previous call to `BayesFluxR_setup` which is time
  ## consuming and requires Julia and BayesFlux.jl
  BayesFluxR_setup(installJulia=TRUE, seed=123)
  net <- Chain(Dense(5, 1))
  like <- likelihood.feedforward_normal(net, Gamma(2.0, 0.5))
  prior <- prior.gaussian(net, 0.5)
  init <- initialise.allsame(Normal(0, 0.5), like, prior)
  x <- matrix(rnorm(5*100), nrow = 5)
  y <- rnorm(100)
  bnn <- BNN(x, y, like, prior, init)
  sampler <- sampler.AdaptiveMH(bnn, 10, 1)
  ch <- mcmc(bnn, 10, 1000, sampler)

## End(Not run)


[Package BayesFluxR version 0.1.3 Index]