Learn R Programming

glarma (version 1.4-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

beta
A named numeric vector of initial coefficients.
y
If requested, the $y$ vector used.
X
If requested, the model matrix.
alpha
The theta parameter in the negative binomial distribution returned by glm.nb. NULL if any other distribution is used.
type
The distribution of the counts in the GLARMA model.
null.deviance
Null deviance of the GLM with the same regression structure as the GLARMA model.
df.null
Null degrees of freedom of the GLM with the same regression structure as the GLARMA model.

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