powered by
Fit the Poisson regression model and calculate the log-likelihood.
fitPoisson(X, y)
a numeric matrix.
a numeric vector.
A number, the log-likelihood.
# NOT RUN { set.seed(1) n <- 100 M <- 10 X <- matrix(rnorm(M*n), ncol=M) mu <- X[, 2] - X[, 3] + X[, 6] - X[, 10] y <- rpois(n, exp(mu)) fitPoisson(X, y) # }
Run the code above in your browser using DataLab