View source: R/initial-class.R
initial | R Documentation |
Helper function to create a valid set of initial values to be used with the fit_bayesPO function.
initial(
beta = numeric(),
delta = numeric(),
lambdaStar = numeric(),
random = FALSE
)
beta |
Either a vector or a single integer. The vector is used if the initial values are provided and the integer is used as the vector size to be randomly generated. |
delta |
Either a vector or a single integer. The vector is used if the initial values are provided and the integer is used as the vector size to be randomly generated. |
lambdaStar |
A positive number. |
random |
A logical value. If |
A bayesPO_initial
object. It can be used in the
fit_bayesPO
function by itself, but must be in a list if multiple
initial values are supplied. Initial values can be combined by adding them
(with the use of '+').
bayesPO_initial-class
.
# Let us create initial values for a model with, say, 3 intensity covariates
# and 4 observability covariates. We add an initial values for both these
# cases due to the intercepts.
# This first one is
in1 <- initial(rep(0, 4), c(0, 2, -1, -2, 3), 100)
# Then we initalize some randomly.
in2 <- initial(4, 5, 100, random = TRUE)
# We can even multiply the random one to generate more. Let us join them all
# to include in a model.
initial_values <- in1 + in2 * 3
# 4 chains are initialized.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.