Evaluate the negative log-likelihood. If there is a linear fixed effects predictor term, this needs to be calculated "manually" prior to calling this function (see example below)
neg_log_likelihood(gp_model, cov_pars, y, fixed_effects = NULL,
aux_pars = NULL)
A GPModel
A vector
with numeric
elements.
Covariance parameters of Gaussian process and random effects
A vector
with response variable data
A numeric
vector
with fixed effects, e.g., containing a linear predictor.
The length of this vector needs to equal the number of training data points.
A vector
with numeric
elements.
Additional parameters for non-Gaussian likelihoods (e.g., shape parameter of a gamma or negative_binomial likelihood)
Fabio Sigrist
# \donttest{
data(GPBoost_data, package = "gpboost")
gp_model <- GPModel(group_data = group_data, likelihood="gaussian")
X1 <- cbind(rep(1,dim(X)[1]), X)
coef <- c(0.1, 0.1, 0.1)
fixed_effects <- as.numeric(X1 %*% coef)
neg_log_likelihood(gp_model, y = y, cov_pars = c(0.1,1,1),
fixed_effects = fixed_effects)
# }
Run the code above in your browser using DataLab