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 isNone
, in which case, it is set tonp.full(n, 1/n)
.- dtypeUnion[float32, float64], optional
The underlying data type. If
None
, it is inferred fromy
, in which casey
must have an underlying data type ofnumpy.float32
ornumpy.float64
. Default isNone
.
- Returns:
- glm
Poisson GLM object.