data_analyst: Fit a Stan/JAGS model in a single data set

Description Usage Arguments Details Examples

Description

Fit a Stan/JAGS model in a single data set

Usage

1
2
3
4
5
data_analyst(i, raw = raw, fl = "~/temp.csv", s.code = NULL,
  s.file = NULL, iter = 2500, warmup = 500, chains = 4, p = NULL,
  dx = NULL, N = NULL, env = NULL, verbose = FALSE,
  debug = FALSE, type = c("stan", "jags", "julia"), stanfit = NA,
  basis = c("identity", "iqr", "sd"), juliabin = NULL, ...)

Arguments

i

iteration in simulated data

raw

data frame with raw data

fl

Filename to output model results for single run (useful for debugging)

s.code

name of a character string with a stan model

s.file

(experimental) character name of a presepecified stan model ("wwbd_simtemplate_20190205", "wwbd_simlogistic_TransParameter_0211201920190211")

iter

Number of "sweep" iterations, or iterations after the burnin/warmup

warmup

warmup (stan) / n.adapt (jags). Number of iterations to allow for adaptation of MCMC parameters/burnin

chains

Number of parallel MCMC chains (default 4)

p

number of beta parameters in outcome model (optional - R makes a guess)

dx

number of columns in data matrix (optional - R makes a guess)

N

Sample size (optional - R makes a guess)

env

environment for existing julia instance

verbose

print extra debugging info? FALSE

debug

print extra debugging info? FALSE

type

Which type of model is it? Can be 'stan' or 'jags'

stanfit

Name of stan_model or stan output that can be recycled. This will use a pre-compiled version of the stan code which cuts simulation time significantly over multiple runs.

basis

how to treat exposure variables: "identity" = do not transform (default); "iqr"= divide every exposure variable by its interquartile range "sd" = divide every exposure variable by its sd Note that the parameterization of the BGF interventions will be invariant to these transformations, so they change the strength of the priors, but no modifications are necessary to examine interventions of the type: "reduce exposure j by p of exposure require that the basis be "identity"

juliabin

NULL or path to directory containing the julia binary file e.g. /Applications/Julia-1.1.app/Contents/Resources/julia/bin/ on mac C:/Users/<username>]/AppData/Local/Julia-1.1.0/bin/ on windows 10

...

arguments to stan(), coda.samples(), or julia.sample() for a Stan, JAGS, or julia model, respectively

Details

Fit a Stan/JAGS model in a single data set

Examples

1
runif(1)

alexpkeil1/wellwise documentation built on June 15, 2019, 7:02 p.m.