Learn R Programming

HelpersMG (version 6.2)

setPriors: Set priors for MHalgoGen()

Description

Set priors for MHalgoGen()

Usage

setPriors(
  par = stop("A vector with init values is necessary."),
  se = NULL,
  density = "dunif",
  rules = NULL,
  silent = FALSE
)

Value

Return a data.frame with priors

Arguments

par

Named vector with init value of parameters

se

Named vector with standard error of parameters

density

Named vector with density or single value

rules

List of rules to define priors

silent

If TRUE, do not show warning.

Author

Marc Girondot marc.girondot@gmail.com

Details

setPriors is a general function to set priors for MHalgoGen()

See Also

Other mcmcComposite functions: MHalgoGen(), as.mcmc.mcmcComposite(), as.parameters(), as.quantiles(), merge.mcmcComposite(), plot.PriorsmcmcComposite(), plot.mcmcComposite(), summary.mcmcComposite()

Examples

Run this code
if (FALSE) {
library(HelpersMG)
rules <- rbind(data.frame(Name="^a", Min=0, Max="x*2"), 
              data.frame(Name="^b", Min=0, Max=100))
par <- c(a0=10, a1=2, b2=20)
(p <- setPriors(par=par, se=NULL, density="dgamma", rules=rules))
(p <- setPriors(par=par, se=NULL, density="dnorm", rules=rules))
(p <- setPriors(par=par, se=NULL, density="dunif", rules=rules))
par <- c(a0=10, a1=2, b2=20, b1=-1)
(p <- setPriors(par=par, se=NULL, density="dgamma", rules=rules))
}

Run the code above in your browser using DataLab