powder: Power posterior sampling using differential evolution

Description Usage Arguments Value Examples

Description

powder Runs power posterior sampling using differential evolution markov chain monte carlo

Usage

1
2
3
4
5
powder(model, data, num.temps = 30, alpha = 0.3, high.temps.first = FALSE,
  n.sequences = 1, current.sequence = 1, n.samples = 1000,
  n.chains = NULL, burnin = 500, meltin = 250, de_params = list(),
  method = "standard", return.samples = TRUE, verbose = TRUE,
  update = 100)

Arguments

model

See LBA for more information and an example.

data

A list of data where each element is the data for a specific subject

num.temps

Number of temperatures (i.e. number of power posteriors to sample from)

alpha

controls the temperature schedule. 0.3 is recommended.

high.temps.first

If true, then the posterior will be sampled from first, followed by lower temperature posteriors. If false, then the prior will be sampled from first, followed by higher temperature posteriors.

n.sequences

This is useful for running parallel power posteriors. If n.sequences = 1, then all power posteriors will be run sequentially. If n.sequences > 1 then num.temps / n.sequences power posteriors will be run sequentially.

current.sequence

If n.sequences > 1, then num.temps / n.sequences power posteriors will be run sequentially. current.sequence is the index of the current sequence. For example, if num.temps = 10, n.sequences = 2, and current.sequence = 1 then temperatures 1 through 5 will be run. If current.sequence = 2 then temperatures 6 through 10 will be run.

n.samples

The number of samples to draw from each power posterior

n.chains

The number of chains to use. By default, n.chains is the number of subject-level parameters times 3.

burnin

The number of samples to discard when computing the marginal likelihood. These samples are included in the raw output.

meltin

The power posteriors are sampled sequentially. When moving to the next power posterior, the sampling process takes some time to adapt to the new power posterior. meltin is the number of samples to discard after moving to the next power posterior. While burnin discards samples from the first power posterior, meltin discard samples for all other power posteriors.

de_params

A list containing the following options for DE-MCMC. See Turner et al. (2013) for details.

  • b The parameter for the uniformly distributed noise term for the DE proposal. Default is .001.

  • migration A logical. Indicates whether to circulate the states of the chains to remedy problem of outlier chains. Default is FALSE.

  • migration.freq A numeric. Number of iterations to wait between each migration step.

  • migration.start A numeric. Iteration to start migrating. This should be after chains are burned in.

  • migration.end A numeric. Iteration to stop migrating. Migration should stop well before sampling is finished.

  • randomize_phi A logical. Assume independence between subject and group-level parameters. Useful for improved sampling of group-level parameters. Default is FALSE.

  • zLag A numeric. When randomize_phi = TRUE and method = 'parallel', zLag is the number of iterations that can be reached into from the past for the z-Update.

  • zStart A numeric. When randomize_phi = TRUE and method = 'parallel', zStart is the iteration to begin z-Updating.

method

A character vector that specifies the type of sampling to be performed and accepts one of the following:

  • standard This option samples from each power posterior along the temperature schedule in sequence

  • parallel This option samples from each power posterior in parallel, where the target density of each chain is a power posterior at a given temperature. Using this method will cause n.chains to default to num.temps.

  • posterior This option samples from the posterior (i.e. the power posterior where temperature = 1). Although this option is useful for parameter estimation, it is not possible to obtain marginal likelihoods via this option.

  • wbic This option option samples from a single power posterior, where the temperature = 1/log(n) (Watanabe, 2013).

return.samples

If true, return subject and group-level samples. Otherwise, return only the log likelihoods from each power posterior.

verbose

Display progress

update

Number of iterations between progress display updates

Value

A list with the following elements.

log.like.list A list containing the log likelihoods for each temperature

theta An array containing the subject-level samples

phi An array containing the group-level samples

Note, if return.samples = FALSE then only log.like.list will be returned.

Examples

1
2
3
4
5
6
7
8
## Not run: 
model = LBA.Individual$new(b=T)
data('individual',package='powder')
pow.out = powder(data=individual, model=model, num.temps=30)
est = marginal.likelihood(pow.out)
print(est)

## End(Not run)

jeff324/powder documentation built on June 4, 2019, 3:04 a.m.