Learn R Programming

glarma (version 1.5-0)

initial: Initial Parameter Generator for GLARMA from GLM

Description

Function used to generate initial values of parameters for the GLARMA model from glm or glm.nb.

Usage

initial(y, X, offset = NULL, type = "Poi", alpha = 1)

Arguments

y
Numeric vector; response variable.
X
Matrix; explanatory variables. A vector of ones should be added to the data matrix as the first column for the $beta$ of the intercept.
offset
Either NULL or a numeric vector of length equal to the number of cases. Used to specify an a priori known component to be included in the linear predictor during fitting.
type
Character; the distribution of the counts.
alpha
Numeric; an optional initial value for the theta parameter in the negative binomial distribution; the default value is 1.

Value

Details

Generates and returns the initial parameters for the GLARMA model under the specified distribution by fitting a generalized linear model.

Examples

Run this code
### Using the polio data
data(Polio)
y <- Polio[, 2]
X <- as.matrix(Polio[, 3:8])

glmMod <- initial(y, X, type = "Poi", alpha=1)
str(glmMod)
head(glmMod)

Run the code above in your browser using DataLab