Description Usage Arguments Value Examples
Add a prior to a PCM object
1 | PCMAddPrior(o, member = "", enclos = "?", prior, inplace = TRUE)
|
o |
a PCM object. |
member |
a member expression. Member expressions are character strings denoting named elements in a list object (see examples). Default: "". |
enclos |
a character string containing the special symbol '?'. This symbol is to be replaced by matching expressions. The result of this substitution can be anything but, usually would be a valid R expression. Default: "?". |
prior |
a prior object. |
inplace |
logical (TRUE by default) indicating if the attribute should be set to the object in the current environment, or a modified object should be returned. |
if inplace is TRUE (default) nothing is returned. Otherwise, a
modified version of o
is returned.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(PCMBase)
model <- PCMBaseTestObjects$model_MixedGaussian_ab
PCMAddPrior(
model,
prior = ParameterPrior(
d = "dunif", r = "runif",
p = list(min = PCMParamGetShortVector(PCMParamLowerLimit(model)),
max = PCMParamGetShortVector(PCMParamUpperLimit(model)))))
PCMAddPrior(
model, "a$Sigma_x", enclos = "diag(?[,,1])",
prior = ParameterPrior(
d = "dunif", r = "runif",
p = list(min = c(0.2, 0.1, 0.1), max = c(5, 5, 5))))
modelPrior <- PCMPrior(model)
vec <- PCMParamGetShortVector(model)
PriorDensity(modelPrior, vec)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.