| paramGen | R Documentation | 
Functions which use the arguments of a glarma call to
generate the initial delta, theta and phi
vectors.
deltaGen(y, X, offset = NULL, phiInit, thetaInit, type, alpha,
         beta, alphaInit)
thetaGen(thetaLags, thetaInit)
phiGen(phiLags, phiInit)
y | 
 Numeric vector; response variable.  | 
X | 
 Matrix; the explanatory variables. A vector of ones should be
added to the data matrix as the first column for the   | 
offset | 
 Either   | 
phiInit | 
 Numeric vector; initial values for the corresponding AR orders.  | 
thetaInit | 
 Numeric vector; initial values for the corresponding orders.  | 
type | 
 Character; the count distribution. The default is the Poisson distribution.  | 
beta | 
 Numeric vector; initial values of the parameters of
variables. It is for the user to construct the specific   | 
alpha | 
 Numeric; an optional initial   | 
alphaInit | 
 Numeric; an initial   | 
thetaLags | 
 Numeric vector; MA orders  | 
phiLags | 
 Numeric vector; AR orders  | 
The thetaGen and phiGen functions take the arguments,
thetaLags, phiLags, thetaInit and phiInit,
in a glarma call to generate and return the initial
theta and phi vectors with orders corresponding to their
names. Then the deltaGen function uses the values returned by
thetaGen, phiGen and other arguments in the
glarma call to generate and return the initial
delta vector with correct names.
thetaGen returns a list containing thetaLags and
thetaInit. thetaInit is the initial theta vector
with its corresponding MA orders as its names.
phiGen returns a list containing phiLags and
phiInit. phiInit is the initial phi vector
with its corresponding MA orders as its names.
deltaGen returns a named vector giving the values of
beta, phiInit, thetaInit plus alpha in the
negative binomial case.
"Cenanning Li" <cli113@aucklanduni.ac.nz> and "William T.M. Dunsmuir" <w.dunsmuir@unsw.edu.au>
### Using the polio data
data(Polio)
y <- Polio[, 2]
X <- as.matrix(Polio[, 3:8])
## generate the theta vector
theta.lags <- c(1, 2, 5)
theta.init <- c(0.0, 0.0, 0.0)
theta <- thetaGen(theta.lags, theta.init)
print(thetaLags <- theta[[1]])
print(theta.init <- theta[[2]])
## generate the vector of phi
phi.lags <- rep(0, 0)
phi.init <- rep(0, 0)
phi <- phiGen(phi.lags, phi.init)
print(phiLags <- phi[[1]])
print(phi.init <- phi[[2]])
## generate the delta vector
delta <- deltaGen(y = y, X = X, phiInit = phi.init,
                  thetaInit = theta.init, type = "Poi",
                  alpha = 1)
delta
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.