initial {pompp}R Documentation

Initial values constructor for pompp modeling

Description

Helper function to create a valid set of initial values to be used with the fit_pompp function.

Usage

initial(
  beta = numeric(),
  delta = numeric(),
  lambdaStar = numeric(),
  marksMean = numeric(),
  marksPrecision = numeric(),
  random = FALSE
)

Arguments

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.

marksMean

Any real number. If random, defines the mean of the random value.

marksPrecision

A positive number. If random, defines the mean of the random value.

random

A logical value. If TRUE, then the initial values are generated from standard normal distribution for beta and delta and from a Beta(lambdaStar, 1) for lambdaStar. The latter is generated as a low value due to potential explosive values resulting from background area scaling.

Value

A pompp_initial object. It can be used in the fit_pompp 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 +).

See Also

pompp_initial-class.

Examples

# 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, 0, 1)

# Then we initalize some randomly.
in2 <- initial(4, 5, 100, 0, 1, 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.

[Package pompp version 0.1.3 Index]