fcs2Priors: Prior Distributions in the FCS2 Model

Description Usage Arguments Details Value See Also Examples

View source: R/fcs2Priors.R

Description

Summarises and plots the prior distribution for each parameter in the FCS2 model. This can be used to aid the selection of parameters for each prior.

Usage

1
fcs2Priors(parameters = list(), print = TRUE, plot = TRUE, prob = 0.95, ...)

Arguments

parameters

a named list of named vectors, each specifying the parameter values for a single prior distribution. See ‘Details’ for how these are specified. Alternatively, an "fcs2Fit" object can be provided, as returned from fcs2FitModel.

print

whether to print a summary of each prior distribution.

plot

whether to plot each prior distribution.

prob

a decimal between 0 and 1 giving the size of the confidence interval displayed for each prior (if print = TRUE).

...

further arguments passed to plot if plotting each prior.

Details

This function can also be used to translate a user-friendly specification of each prior distribution to the form required by INLA and BUGS to fit the model.

Each prior distribution can be specified either by their mean and standard deviation sd, mean and variance var or by providing values for their parameters.

Value

Invisibly returns a modified list of prior parameters with each prior specified using standardised parameters, as required for INLA and BUGS:

The log-Normal prior for the shape parameter r is given by the mean mu and precision tau of the equivalent Normal prior for log(r).
The Beta prior for the catch probability q is given by two shape parameters a and b.
The Normal prior for a linear variable beta.* or gamma.* is given by the mean and precision.
The Gamma prior for a precision hyperparameter tau.* or phi.* is given by the shape a and rate b.

Prior parameters specified for a scale hyperparameter sigma.* or nu.* (following the hyperprior distribution) are transformed to the corresponding precision parameter tau.* or phi.* respectively.

See Also

fcs2FitModel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Specify a range of priors by their parameters:
# each prior is plotted and summarised by default
fcs2Priors(list(r=c(mu=0, sigma=3),
                q=c(a=0.5, b=0.5),
                beta=c(mean=0, precision=0.5),
                phi=c(a=1, b=0.3)))

# Priors can also be specified by their mean and sd or var:
fcs2Priors(list(r=c(mean=3, sd=10),
                q=c(mean=0.6, sd=0.2),
                beta=c(mean=0, var=2),
                sigma=c(mean=1.5, sd=3)))

aquaMetrics/fcs2 documentation built on Aug. 21, 2021, 12:55 p.m.