negbin_schur_correction: NB Schur Correction

View source: R/negbin_helpers.R

negbin_schur_correctionR Documentation

NB Schur Correction

Description

Computes the Schur complement correction to account for uncertainty in estimating \theta. Structure is identical to weibull_schur_correction: the joint information is partitioned into (\boldsymbol{\beta}, \theta) blocks and the correction is -\mathbf{I}_{\beta\theta} I_{\theta\theta}^{-1}\mathbf{I}_{\beta\theta}^{\top}.

Usage

negbin_schur_correction(
  X,
  y,
  B,
  dispersion,
  order_list,
  K,
  family,
  observation_weights
)

Arguments

X

List of partition design matrices.

y

List of partition response vectors.

B

List of partition coefficient vectors.

dispersion

Scalar shape parameter \theta.

order_list

List of observation indices per partition.

K

Number of knots.

family

Family object.

observation_weights

Observation weights.

Details

The cross-derivative (score of \eta_i w.r.t. \theta) is

\frac{\partial^2 \ell}{\partial \eta_i \partial \theta} = \frac{(y_i - \mu_i)\mu_i}{(\theta + \mu_i)^2}

The second derivative of the log-likelihood w.r.t. \theta is

I_{\theta\theta} = -\sum_i w_i \bigl[ \psi'(y_i + \theta) - \psi'(\theta) + \frac{1}{\theta} - \frac{2}{\mu_i + \theta} + \frac{y_i + \theta}{(\mu_i + \theta)^2}\bigr]

where \psi' is the trigamma function.

Value

List of K+1 correction matrices, with 0 for empty partitions.


lgspline documentation built on May 8, 2026, 5:07 p.m.