LIKpoisson_glmm: Likelihood of the Poisson GLMM

Description Usage Arguments Details Functions Examples

View source: R/LIKpoisson_glmm.R

Description

The likelihood of the parameters beta and sigma in a Poisson GLMM is computed. The integral is calculated with Gauss-Hermite quadrature.

Usage

1
2
3

Arguments

beta

scalar

sigma

scalar

x

vector, regressor

y

vector, regressand

Details

The function dpois is used to evaluate the conditional likelihood, as it is fast (implemented in C) and can handle large values of y, that can otherwise be problematic in the evaluation of factorial(y).

The loglikelihood can sometimes be obtained even when the likelihood evaluates to zero (numerically).

Functions

Examples

1
2
3
4
5
6
7
8
9
x = 1:3
y = c(2,4,6)
beta = 1
sigma = 1

betavec = seq(0, 5, by =0.1)
likvec = numeric(length(betavec))
for(i in 1:length(likvec)) likvec[i] = LIKpoisson_glmm(betavec[i], sigma, x, y)
plot(betavec, likvec)

johannabertl/ApproxML documentation built on May 22, 2019, 2:19 p.m.