bam_estimate: Estimate BAM

Description Usage Arguments

View source: R/estimate.R

Description

Fits a BAM model of one of several variants using Hamiltonian Monte Carlo.

Usage

1
2
3
4
5
bam_estimate(bamdata, variant = c("manning", "amhg", "manning_amhg"),
  bampriors = NULL, meas_error = TRUE, reparam = TRUE,
  cores = getOption("mc.cores", default = parallel::detectCores()),
  chains = 3L, iter = 1000L, stanmodel = NULL, pars = NULL,
  include = FALSE, ...)

Arguments

bamdata

A bamdata object, as produced by bam_data()

variant

Which BAM variant to use: amhg, manning_amhg, or manning

bampriors

A bampriors object. If none is supplied, defaults are used from calling bam_priors(bamdata) (with no other arguments).

meas_error

Include measurement error in inference? Setting this to TRUE will slow down the inference by roughly an order of mangnitude.

reparam

Reparameterize measurement errors to speed up sampling?

cores

Number of processing cores for running chains in parallel. See ?rstan::sampling. Defaults to parallel::detectCores().

chains

A positive integer specifying the number of Markov chains. The default is 3.

iter

Number of iterations per chain (including warmup). Defaults to 1000.

stanmodel

A stanmodel object to use instead of one of the default models.

pars

(passed to rstan::sampling()) A vector of character strings specifying parameters of interest to be returned in the stanfit object. If not specified, a default parameter set is returned.

include

(passed to rstan::sampling()) Defaults to FALSE, which excludes parameters specified in pars from the returned model.

...

Other arguments passed to rstan::sampling() for customizing the Monte Carlo sampler


markwh/bamr documentation built on Aug. 7, 2020, 11:52 p.m.