Skip to contents

Formula: l_p = sum_i y_i eta_i - sum_i exp(eta_i) - sum_i log(y_i!) - (lambda/2) sum_j beta_j^2, eta_i = beta_0 + x_i'beta

Usage

Poispen(X, y, lam = 1, penalty = "ridge", n_iter = 100L, add_intercept = TRUE)

Arguments

X

Design matrix without an intercept column.

y

Observed counts.

lam

Penalty strength lambda.

penalty

'ridge' or 'lasso'.

n_iter

Fixed number of iteratively reweighted least squares iterations.

add_intercept

Prepend a column of ones and leave its coefficient unpenalized.

Value

List with beta, fitted, loglik, n, p.

References

Montesinos Lopez, Montesinos Lopez and Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, doi:10.1007/978-3-030-89010-0. Chapter 7, Sect. 7.5 p. 232. The book fits this by the second-order approximation of the log-likelihood solved as a weighted least squares problem; the intercept is unpenalized. A FIXED iteration count is used rather than a tolerance stop, so both language arms perform identically many updates.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Poispen(V, V)
#> $beta
#> [1] 0.3127190 0.2337641
#> 
#> $fitted
#> [1] 1.727168 2.182011 2.756636 3.482586 4.399713 5.558361 7.022135 8.871389
#> 
#> $loglik
#> [1] -13.21372
#> 
#> $n
#> [1] 8
#> 
#> $p
#> [1] 1
#> 
#> $method
#> [1] "Penalized Poisson regression, MVSML Sect. 7.5"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"