adelie.glm.poisson#

adelie.glm.poisson(y: ndarray, *, weights: ndarray | None = None, dtype: float32 | float64 | None = None)[source]#

Creates a Poisson GLM family object.

The Poisson GLM family specifies the loss function as:

\[\begin{align*} \ell(\eta) = \sum\limits_{i=1}^n w_i \left( -y_i \eta_i + e^{\eta_i} \right) \end{align*}\]

The link function is given by

\[\begin{align*} g(\mu)_i &= \log(\mu_i) \end{align*}\]

We assume that \(y_i \in \mathbb{N}_0\).

Parameters:
y(n,) ndarray

Response vector \(y\).

weights(n,) ndarray, optional

Observation weights \(W\). Weights are normalized such that they sum to 1. Default is None, in which case, it is set to np.full(n, 1/n).

dtypeUnion[float32, float64], optional

The underlying data type. If None, it is inferred from y, in which case y must have an underlying data type of numpy.float32 or numpy.float64. Default is None.

Returns:
glm

Poisson GLM object.