initial {glarma} | R Documentation |
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
|
offset |
Either |
type |
Character; the distribution of the counts. |
alpha |
Numeric; an optional initial value for the
|
Details
Generates and returns the initial parameters for the GLARMA model under the specified distribution by fitting a generalized linear model.
Value
beta |
A named numeric vector of initial coefficients. |
y |
If requested, the |
X |
If requested, the model matrix. |
alpha |
The |
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. |
Author(s)
"William T.M. Dunsmuir" <w.dunsmuir@unsw.edu.au>
Examples
### 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)