plotPrior: Plot Prior Distributions

View source: R/plotPrior.R

plotPriorR Documentation

Plot Prior Distributions

Description

Plots prior distributions for group means, standard deviation, and correlations of MPT parameters across participants.

Usage

plotPrior(prior, probitInverse = "mean", M = 5000, nCPU = 3, ...)

Arguments

prior

a named list defining the priors. For the traitMPT, the default is list(mu = "dnorm(0,1)", xi="dunif(0,10)", V=diag(S), df=S+1), where S is the number of free parameters. For the betaMPT, the default is list(alpha ="dgamma(1,.1)", beta = "dgamma(1,.1)"). Note that the normal distribution "dnorm(mu,prec)" is parameterized as in JAGS by the mean and precision (= 1/variance).

probitInverse

which latent-probit parameters (for traitMPT model) to transform to probability scale. Either "none", "mean" (simple transformation \Phi(\mu)), or "mean_sd" (see probitInverse)

M

number of random samples to approximate priors of group-level parameters

nCPU

number of CPUs used for parallel sampling. For large models and many participants, this may require a lot of memory.

...

further arguments passed to plot

Details

This function samples from a set of hyperpriors (either for hierarchical traitMPT or betaMPT structure) to approximate the implied prior distributions on the parameters of interest (group-level mean, SD, and correlations of MPT parameters). Note that the normal distribution "dnorm(mu,prec)" is parameterized as in JAGS by the mean and precision (= 1/variance).

See Also

priorPredictive

Examples

## Not run: 
# default priors for traitMPT:
plotPrior(list(
  mu = "dnorm(0, 1)",
  xi = "dunif(0, 10)",
  V = diag(2),
  df = 2 + 1
), M = 4000)

# default priors for betaMPT:
plotPrior(list(
  alpha = "dgamma(1, 0.1)",
  beta = "dgamma(1, 0.1)"
), M = 4000)

## End(Not run)

denis-arnold/TreeBUGS documentation built on May 13, 2024, 6:34 p.m.