summary.NBKP: Summary of a Fitted NBKP Model

View source: R/summary_NBKP.R

summary.NBKPR Documentation

Summary of a Fitted NBKP Model

Description

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.

Usage

## S3 method for class 'NBKP'
summary(object, ...)

Arguments

object

An object of class "NBKP" from fit_NBKP.

...

Additional arguments passed to the generic summary method (currently not used).

Value

A list containing key summaries of the fitted model:

n_obs

Number of training observations.

input_dim

Input dimensionality (number of columns in X).

kernel

Kernel type used in the model.

theta_opt

Estimated kernel hyperparameters.

loss

Loss function type used in the model.

loss_min

Minimum value of the loss function achieved.

prior

Prior type used (e.g., "noninformative", "fixed", "adaptive").

r0

Prior precision parameter.

mu0

Prior mean parameter (for fixed prior).

phi

Negative‑binomial dispersion parameter.

post_mean

Posterior mean count estimates at training points.

post_var

Posterior variance estimates of latent mean counts.

References

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.

See Also

fit_NBKP for model fitting.

Examples


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)



NBKP documentation built on June 18, 2026, 1:06 a.m.