bcgp_sampling-bcgpmodel-method: Draw samples from a BCGP model

Description Usage Arguments Details Value

Description

bcgp_sampling draws samples from the model defined by class bcgpmodel

Usage

1
2
3
4
5
## S4 method for signature 'bcgpmodel'
bcgp_sampling(object, algorithm = c("NUTS", "MH"),
  scaled = TRUE, chains = 4L, cores = getOption("mc.cores", 1L),
  init = "random", numUpdates = 5, nAdapt = 1000, burnin = 1000,
  nmcmc = 10000, thin = 1, ..., control = NULL)

Arguments

object

An instance of S4 class bcgpmodel.

algorithm

Either "NUTS" for the No U-Turn Sampler implemented by Stan, or "MH" for a Metropolis-Hastings algorithm

scaled

A logical indicating whether the data should be scaled before fitting. It is highly recommended to scale the data before fitting.

chains

A positive integer specifying the number of Markov chains

cores

The number of cores to use when executing the Markov chains in parallel. The default is to use the value of the mc.cores option if it has been set and otherwise to default to 1 core. However, it is recommended to set it to be as many processors as the hardware and RAM allow (up to the number of chains). See detectCoresif you don't know this number for your system.

init

Can be either the string "random" or a list of length chains. The elements of this list should be named lists, where each of these has the name of a parameter and is used to specify the initial values for that parameter for the corresponding chain.

init = "random" (default): The initial values will be generated randomly from their respective prior distributions.

init via list: Set initial values by providing a list equal in length to the number of Markov chains. A call to create_inits() will assist in the correct creation of this list.

numUpdates

A positive integer for the number of updates in the proposal stepsize adaptation phase. Ignored if algorithm = "NUTS".

burnin

A positive integer for the number of burnin samples to discard after the stepsize adaptation phase is finished. This is equivalent to the parameter warmup in stan

nmcmc

The number of samples to be kept for each Markov chain.

thin

A positive integer specifying the period for saving samples. The default is 1, and this number should not be changed, as thinning isn't necessary in these models, and it throws away information. Currently, only thin = 1 is supported, and this argument may be deprecated in the future.

...

optional parameters, only if algorithm = "NUTS". See the documentation for stan. Any

numAdapt

A positive integer for the number of samples within each update in the proposal stepsize adaptation phase. Ignored if algorithm = "NUTS".

Details

This returns an instance of S4 class bcgpfit. It contains information about the data, model, sampling algorithm, and sample draws from the posterior

Value

An instance of S4 class bcgpfit. It contains information about the data, model, sampling algorithm, and sample draws from the posterior.


cbdavis33/bcgp documentation built on Oct. 1, 2019, 8:07 a.m.