17.7 Poisson-log generalized linear model (Poisson regression)
Stan also supplies a single function for a generalized linear model with Poisson likelihood and log link function, i.e. a function for a Poisson regression. This provides a more efficient implementation of Poisson regression than a manually written regression in terms of a Poisson likelihood and matrix multiplication.
17.7.1 Probability mass function
If x∈Rn⋅m,α∈Rn,β∈Rm, then for y∈Nn, PoisonLogGLM(y|x,α,β)=∏1≤i≤nPoisson(yi|exp(αi+xi⋅β)).
17.7.2 Sampling statement
y ~
poisson_log_glm
(x, alpha, beta)
Increment target log probability density with poisson_log_glm_lupmf(y | x, alpha, beta)
.
Available since 2.19
17.7.3 Stan functions
real
poisson_log_glm_lpmf
(int y | matrix x, real alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
.
Available since 2.23
real
poisson_log_glm_lupmf
(int y | matrix x, real alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
dropping constant additive terms.
Available since 2.25
real
poisson_log_glm_lpmf
(int y | matrix x, vector alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
.
Available since 2.23
real
poisson_log_glm_lupmf
(int y | matrix x, vector alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
dropping constant additive terms.
Available since 2.25
real
poisson_log_glm_lpmf
(array[] int y | row_vector x, real alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
.
Available since 2.23
real
poisson_log_glm_lupmf
(array[] int y | row_vector x, real alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
dropping constant additive terms.
Available since 2.25
real
poisson_log_glm_lpmf
(array[] int y | row_vector x, vector alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
.
Available since 2.23
real
poisson_log_glm_lupmf
(array[] int y | row_vector x, vector alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
dropping constant additive terms.
Available since 2.25
real
poisson_log_glm_lpmf
(array[] int y | matrix x, real alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
.
Available since 2.18
real
poisson_log_glm_lupmf
(array[] int y | matrix x, real alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
dropping constant additive terms.
Available since 2.25
real
poisson_log_glm_lpmf
(array[] int y | matrix x, vector alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
.
Available since 2.18
real
poisson_log_glm_lupmf
(array[] int y | matrix x, vector alpha, vector beta)
The log Poisson probability mass of y
given the log-rate alpha + x * beta
dropping constant additive terms.
Available since 2.25