Learn R Programming

SDGLM (version 0.4.0)

simGamma: Simulate Gamma Dynamic GLM

Description

Generates a dynamic regression dataset for gamma family GLM where the rate parameter follows a dynamic process.

Usage

simGamma(N = 1000L, p = 4L, alpha_gamma = 2)

Value

List with components:

X

N x p design matrix.

Y

Numeric vector of length N, gamma distributed observations.

beta

True coefficient vector.

alpha_gamma

Shape parameter used.

Arguments

N

Integer > 1, number of observations.

p

Integer > 0, number of predictors.

alpha_gamma

Numeric > 0, shape parameter for gamma distribution (default = 2).

Examples

Run this code
set.seed(3)
dat <- simGamma(N = 500, p = 3)
hist(dat$Y, main = "Gamma Data")

Run the code above in your browser using DataLab