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().
mu_eta(family, eta)A numeric vector of the same length as eta, containing
the derivative \(d\mu/d\eta\).
A character string specifying the distribution family:
one of "gaussian", "binomial", or "poisson".
Numeric vector of linear predictor values.
Ines Ortega-Fernandez, Marta Sestelo
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.
inv_link, link