Learn R Programming

neuralGAM (version 2.0.1)

mu_eta: Derivative of the Inverse Link Function

Description

Computes the derivative of the inverse link function \(d\mu/d\eta\) for common distributtion families supported by neuralGAM ("gaussian", "binomial", "poisson"). This quantity is required when applying the delta method to obtain standard errors on the response scale in predict().

Usage

mu_eta(family, eta)

Value

A numeric vector of the same length as eta, containing the derivative \(d\mu/d\eta\).

Arguments

family

A character string specifying the distribution family: one of "gaussian", "binomial", or "poisson".

eta

Numeric vector of linear predictor values.

Author

Ines Ortega-Fernandez, Marta Sestelo

Details

For a neuralGAM with linear predictor \(\eta\) and mean response \(\mu\): $$\mu = g^{-1}(\eta),$$ the derivative \(d\mu/d\eta\) depends on the family:

  • Gaussian (identity link): \(d\mu/d\eta = 1\).

  • Binomial (logit link): \(d\mu/d\eta = \mu (1-\mu)\).

  • Poisson (log link): \(d\mu/d\eta = \mu\).

Internally, values of \(\eta\) are clamped to avoid numerical overflow/underflow in exp() and \(\mu\) is constrained away from \(0\) and \(1\) for stability.

See Also

inv_link, link