| summary.NBKP | R Documentation |
Provides a structured summary of a fitted Negative Binomial Kernel Process (NBKP) model. This function reports the model configuration, prior specification, kernel settings, and key posterior quantities, giving users a concise overview of the fitting results.
## S3 method for class 'NBKP'
summary(object, ...)
object |
An object of class |
... |
Additional arguments passed to the generic |
A list containing key summaries of the fitted model:
n_obsNumber of training observations.
input_dimInput dimensionality (number of columns in X).
kernelKernel type used in the model.
theta_optEstimated kernel hyperparameters.
lossLoss function type used in the model.
loss_minMinimum value of the loss function achieved.
priorPrior type used (e.g., "noninformative", "fixed", "adaptive").
r0Prior precision parameter.
mu0Prior mean parameter (for fixed prior).
phiNegative‑binomial dispersion parameter.
post_meanPosterior mean count estimates at training points.
post_varPosterior variance estimates of latent mean counts.
Zhao J, Qing K, Xu J (2025). BKP: An R Package for Beta Kernel Process Modeling. arXiv. https://doi.org/10.48550/arxiv.2508.10447.
fit_NBKP for model fitting.
set.seed(123)
# Define true mean function
true_mu_fun <- function(x) {
exp(sin(x) + 0.5)
}
n <- 30
Xbounds <- matrix(c(-2, 2), nrow = 1)
X <- tgp::lhs(n = n, rect = Xbounds)
true_mu <- true_mu_fun(X)
y <- rnbinom(n, size = 1, mu = true_mu)
# Fit NBKP model
model1 <- fit_NBKP(X, y, Xbounds = Xbounds)
summary(model1)
# 2D Example
set.seed(123)
true_mu_fun <- function(X) {
if(is.null(nrow(X))) X <- matrix(X, nrow=1)
x1 <- 4*X[,1] - 2
x2 <- 4*X[,2] - 2
f <- sin(2*pi*x1) * cos(2*pi*x2)
return(exp(f))
}
n <- 100
Xbounds <- matrix(c(0, 0, 1, 1), nrow = 2)
X <- tgp::lhs(n = n, rect = Xbounds)
true_mu <- true_mu_fun(X)
y <- rnbinom(n, size = 0.5, mu = true_mu)
model2 <- fit_NBKP(X, y, Xbounds = Xbounds)
summary(model2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.