Skip to content

Link functions¤

Links map the mean parameter \(\mu\) of a GLM family to a linear predictor \(\eta\):

  • forward: \(\eta = g(\mu)\)
  • inverse: \(\mu = g^{-1}(\eta)\)

Each response family defines its valid links. Constructing a family with an incompatible link raises ValueError.

jaxqtl.distribution.AbstractLink

Abstract base for GLM link functions mapping the mean parameter to the linear predictor \(g: \mu \mapsto \eta\).

__call__(self, mu: ArrayLike) -> jax.Array ¤

Compute the forward link \(g(\mu) = \eta\).

Arguments:

  • mu: Mean parameter $\mu$ (on the domain of the link).

Returns:

Linear predictor \(\eta\).

inverse(self, eta: ArrayLike) -> jax.Array ¤

Compute the inverse link \(g^{-1}(\eta) = \mu\).

Arguments:

  • eta: Linear predictor $\eta$.

Returns:

Mean parameter \(\mu\).

deriv(self, mu: ArrayLike) -> jax.Array ¤

Compute the derivative \(g'(\mu)\).

Arguments:

  • mu: Mean parameter $\mu$.

Returns:

Derivative \(g'(\mu)\) evaluated at \(\mu\).

inverse_deriv(self, eta: ArrayLike) -> jax.Array ¤

Compute the derivative of the inverse link \(g^{-1}'(\eta)\).

Arguments:

  • eta: Linear predictor $\eta$.

Returns:

Derivative \(g^{-1}'(\eta)\) evaluated at \(\eta\).

Identity link with \(g(\mu) = \mu\) for \(\mu \in \mathbb{R}\).

__init__(self) -> None ¤

Initialize self. See help(type(self)) for accurate signature.


Log link with \(g(\mu) = \log(\mu)\) on \(\mu > 0\).

__init__(self) -> None ¤

Initialize self. See help(type(self)) for accurate signature.


Logit link with \(g(\mu) = \log(\mu / (1-\mu))\) on \(\mu \in (0, 1)\).

__init__(self) -> None ¤

Initialize self. See help(type(self)) for accurate signature.


Inverse link with \(g(\mu) = 1/\mu\) on \(\mu > 0\).

__init__(self) -> None ¤

Initialize self. See help(type(self)) for accurate signature.


Power link with \(g(\mu) = \mu^{p}\) on \(\mu > 0\), configurable exponent \(p\).

__init__(self, power: typing.Any = 1.0) ¤

Create a power link.

Arguments:

  • power: Exponent p in $g(\mu) = \mu^{p}$.

Returns:

None


Negative Binomial-specific log link with \(g(\mu) = \log(\mu \alpha / (\mu \alpha + 1))\) where \(\alpha\) is dispersion.

__init__(self, alpha: typing.Any = 1.0) ¤

Create a Negative Binomial-specific link parameterized by dispersion.

Arguments:

  • alpha: Dispersion parameter $\alpha$ used by the link.

Returns:

None