See the Mathematical description of lgpr models vignette for more information about the connection between different options and the created statistical model.
create_model( formula, data, likelihood = "gaussian", prior = NULL, c_hat = NULL, num_trials = NULL, options = NULL, prior_only = FALSE, verbose = FALSE, sample_f = !(likelihood == "gaussian") )
The model formula, where
it must contain exatly one tilde (
~), with response
variable on the left-hand side and model terms on the right-hand side
terms are be separated by a plus (
all variables appearing in
formula must be
See the "Model formula syntax" section below (
instructions on how to specify the model terms.
data.frame where each column corresponds to one
variable, and each row is one observation. Continuous covariates and the
response variable must have type
"numeric" and categorical covariates
must have type
"factor". Missing values should be indicated with
NA. The response variable cannot contain missing
values. Column names should not contain trailing or leading underscores.
Determines the observation model. Must be either
"bb" (beta binomial).
A named list, defining the prior distribution of model
(hyper)parameters. See the "Defining priors" section below
The GP mean. This should only be given if
TRUE, otherwise the GP will always have zero mean. If
TRUE, the given
c_hat can be a vector of length
dim(data), or a real number defining a constant GP mean. If not
c_hat is set to
c_hat = mean(y), if
p = mean(y/num_trials) if
y denotes the response variable measurements.
This argument (number of trials) is only needed when
"bb". Must have length one or
equal to the number of data points. Setting
likelihood="binomial" corresponds to Bernoulli observation model.
A named list with the following possible fields:
delta Amount of added jitter to ensure positive definite
vm_params Variance mask function parameters (numeric
vector of length 2).
NULL, default options are used. The defaults
are equivalent to
options = list(delta = 1e-8, vm_params = c(0.025, 1)).
Should some informative messages be printed?
Determines if the latent function values are sampled
TRUE if likelihood is not
"gaussian"). If this is
TRUE, the response variable will be normalized to have zero mean
and unit variance.
An object of class lgpmodel, containing the
Stan input created based on parsing the specified
prior, and other options.