par_stan: Run stan chains in parallel

Description Usage Arguments Value

View source: R/stan_tools.R

Description

Uses 'mclapply' as backend, and 'sflist2stanfit' to convert to a single, multi-chain ‘stanfit' object. If you don’t supply the 'fit' parameter (previously compiled Stan model object) then it will compile one and re-use it for all the chains. Returns a single

Usage

1
2
par_stan(data, file, fit = stan(file, data = data, chains = 0), chains = 4,
  cores = chains, rng_seed = 1, ...)

Arguments

data

same as 'stan'

file

filename for a stan model file. ignored if 'fit' also specified.

fit

fitted 'stan' object. Overrides any provided 'file' argument.

chains

number of chains to run (default: 4).

cores

number of cores to use, which controls how many chains can be run simultaneously. (passed to 'mclapply', so see there for more information) (default: 'chains')

rng_seed

optional, passed to each chain. (default: 1).

...

additional arguments passed to 'stan' for each chain.

Value

A single 'stanfit' object with 'chains' chains.


kleinschmidt/phonetic-sup-unsup documentation built on May 20, 2019, 12:33 p.m.