## 500 variables, hence 500 univariate regressions are to be fitted
x = matrix( rnorm(100 * 500), ncol = 500 )
y = rpois(100, 10)
system.time( poisson_only(x, y) )
b1 = poisson_only(x, y)
b2 = numeric(500)
system.time( for (i in 1:500) b2[i] = glm(y ~ x[, i], poisson)$deviance )
Run the code above in your browser using DataLab