Description
Usage
Arguments
Value
Author(s)
View source: R/get_jagscode.R
Get JAGS code for a prior
 (prior, i, varying_group = )

prior 
Named list. Names are parameter names (cp_i , int_i , xvar_i ,
'sigma“) and the values are either
A JAGS distribution (e.g., int_1 = "dnorm(0, 1) T(0,)" ) indicating a
conventional prior distribution. Uninformative priors based on data
properties are used where priors are not specified. This ensures good
parameter estimations, but it is a questionable for hypothesis testing.
mcp uses SD (not precision) for dnorm, dt, dlogis, etc. See
details. Change points are forced to be ordered through the priors using
truncation, except for uniform priors where the lower bound should be
greater than the previous change point, dunif(cp_1, MAXX) .
A numerical value (e.g., int_1 = 2.1 ) indicating a fixed value.
A model parameter name (e.g., int_2 = "int_1" ), indicating that this parameter is shared 
typically between segments. If two varying effects are shared this way,
they will need to have the same grouping variable.
A scaled Dirichlet prior is supported for change points if they are all set to
cp_i = "dirichlet(N) where N is the alpha for this change point and
N = 1 is most often used. This prior is less informative about the
location of the change points than the default uniform prior, but it
samples less efficiently, so you will often need to set iter higher.
It is recommended for hypothesis testing and for the estimation of more
than 5 change points. Read more.

i 
The index in prior to get code for

varying_group 
String or NULL (default). Null indicates a population
level prior. String indicates a varyingeffects prior (one for each group
level).

A string
Jonas Kristoffer Lindeløv jonas@lindeloev.dk
mcp documentation built on Aug. 3, 2020, 5:07 p.m.