Learn R Programming

ToxicR (version 22.12.1.0.7)

normprior: normprior - create a normal prior object

Description

Specify a normal prior for a ToxicR Bayesian model fit.

Usage

normprior(mean = 0, sd = 1, lb = -100, ub = 100)

Value

a normal prior model object. This object essentially a vector with the first element as 1 (for normal), the second element the mean, the third element the variance, the fourth and fifth elements the lower and upper bounds, respectively.

Arguments

mean

mean of the prior

sd

sd of the prior distribution.

lb

lower bound on the distribution. Necessary for the optimization algorithms, To make sure it is a fully normal prior, make lb small relative to the mean/sd.

ub

Upper bound on the distribution. Necessary for the optimization algorithms, To make sure it is a fully normal prior, make ub large relative to the mean/sd.

Examples

Run this code
 # Normal Prior with mean 0,sd-1
 normprior(mean = 0, sd = 1, lb = -1e4, ub=1e4)

 # Truncated Normal prior, Truncated below at 0
 normprior(mean = 0, sd = 1, lb = 0, ub=1e4)

Run the code above in your browser using DataLab