Computes the loss used to fit the DKP model. Supports the Brier score (mean squared error) and negative log-loss (cross-entropy), under different prior specifications.
Arguments
- gamma
A numeric vector of log-transformed kernel hyperparameters.
- Xnorm
A numeric matrix of normalized inputs (each column scaled to
[0,1]
).- Y
Matrix of observed multinomial counts, with dimension \(n \times q\).
- prior
Type of prior to use. One of
"noninformative"
,"fixed"
, or"adaptive"
.- r0
Global prior precision (only used when
prior = "fixed"
or"adaptive"
).- p0
Global prior mean vector (only used when
prior = "fixed"
). Must be of length \(q\).- loss
Loss function for kernel hyperparameter tuning. One of
"brier"
(default) or"log_loss"
.- kernel
Kernel function for local weighting. Choose from
"gaussian"
,"matern52"
, or"matern32"
.