runInference: Run inference using Markov chain Monte Carlo

Description Usage Arguments Value See Also

View source: R/runInference.R

Description

Generates posterior samples by successively applying the Markov transition operator starting from a given initial state. The samples are written to the path provided.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
runInference(
  initialState,
  projectPath,
  sampleSize,
  burninInterval = 0L,
  thinningInterval = 1L,
  checkpointInterval = 20L,
  writeBufferSize = 10L,
  sampler = "PCG-I"
)

Arguments

initialState

a State jobj which represents the initial state of the Markov chain

projectPath

A string specifying the path to save output (includes samples and diagnostics). HDFS and local filesystems are supported.

sampleSize

A positive integer specifying the desired number of samples (after burn-in and thinning)

burninInterval

A non-negative integer specifying the number of initial samples to discard as burn-in. The default is 0, which means no burn-in is applied.

thinningInterval

A positive integer specifying the period for saving samples to disk. The default value is 1, which means no thinning is applied.

checkpointInterval

A non-negative integer specifying the period for checkpointing. This prevents the lineage of the RDD (internal to state) from becoming too long. Smaller values require more frequent writing to disk, larger values require more CPU/memory. The default value of 20, is a reasonable trade-off.

writeBufferSize

A positive integer specifying the number of samples to queue in memory before writing to disk.

sampler

One of 'PCG-I', 'PCG-II', 'Gibbs' or 'Gibbs-Sequential'.

Value

a State jobj which represents the state at the end of the Markov chain

See Also

initializeState, loadState


cleanzr/dblinkR documentation built on June 13, 2021, 4:17 a.m.