Learn R Programming

SDGLM (version 0.4.0)

simPoisBin: Simulate Poisson-Binomial Dynamic GLM

Description

Generates a dynamic regression dataset where each response y_i | p_i ~ Binomial(n, p_i) with p_i = plogis(x_i' beta_i). The latent coefficients beta_i follow a Vector-AR(1) process.

Usage

simPoisBin(N = 1000L, n = 10L, q = 4L)

Value

A list with components:

X

N x q design matrix.

Y

Integer vector of length N, counts of successes.

beta

N x q matrix of dynamic regression coefficients.

G

q x q autoregressive multiplier matrix (diagonal).

Sig

q x q innovation covariance matrix (diagonal).

Arguments

N

Integer > 1, number of time points/individuals.

n

Integer > 0, binomial number of trials (constant across units).

q

Integer > 0, number of predictors (including intercept if desired).

Examples

Run this code
set.seed(1)
dat <- simPoisBin(N = 500, n = 10, q = 4)
head(dat$Y)

Run the code above in your browser using DataLab