pgam {pgam} | R Documentation |
Poisson-Gamma Additive Models
Description
Fit Poisson-Gamma Additive Models using the roughness penalty approach
Usage
pgam(formula, dataset, omega = 0.8, beta = 0.1, offset = 1, digits = getOption("digits"),
na.action="na.exclude", maxit = 100, eps = 1e-06, lfn.scale=1, control = list(),
optim.method = "L-BFGS-B", bkf.eps = 0.001, bkf.maxit = 100, se.estimation = "numerical",
verbose = TRUE)
Arguments
formula |
a model formula. See |
dataset |
a data set in the environment search path. Missing data is temporarily not handled |
omega |
initial value for the discount factor |
beta |
vector of initial values for covariates coefficients. If a sigle value is supplied it is replicated to fill in the whole vector |
offset |
default is |
digits |
number of decimal places for printing information out |
na.action |
action to be taken if missing values are found. Default is |
maxit |
convergence control iterations |
eps |
convergence control criterion |
lfn.scale |
scales the likelihood function and is passed to |
control |
convergence control of |
optim.method |
optimization method passed to |
bkf.eps |
convergence control criterion for the backfitting algorithm |
bkf.maxit |
convergence control iterations for the backfitting algorithm |
se.estimation |
if |
verbose |
if |
Details
The formula is parsed by formparser
in order to extract all the information necessary for model fit. Split the model into two parts regarding the parametric nature of the model.
A model can be specified as following:
Y~f\left(sf_{r}\right)+V1+V2+V3+g\left(V4,df_{4}\right)+g\left(V5,df_{5}\right)
where sf_{r}
is a seasonal factor with period r
and df_{i}
is the degree of freedom of the smoother of the i-th covariate. Actually, two new formulae will be created:
~sf_{1}+\dots+sf_{r}+V1+V2+V3
and
~V4+V5
These two formulae will be used to build the necessary datasets for model estimation. Dummy variables reproducing the seasonal factors will be created also.
Models without explanatory variables must be specified as in the following formula
Y~NULL
There are a lot of details to be written. It will be very soon.
Specific information can be obtained on functions help.
This algorithm fits fully parametric Poisson-Gamma model also.
Value
List containing an object of class pgam
.
Author(s)
Washington Leite Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br
References
Junger, W. L. (2004) Semiparametric Poisson-Gamma models: a roughness penalty approach. MSc Dissertation. Rio de Janeiro, PUC-Rio, Department of Electrical Engineering.
Harvey, A. C., Fernandes, C. (1989) Time series models for count data or qualitative observations. Journal of Business and Economic Statistics, 7(4):407–417
Green, P. J., Silverman, B. W. (1994) Nonparametric Regression and Generalized Linear Models: a roughness penalty approach. Chapman and Hall, London
See Also
predict.pgam
, formparser
, residuals.pgam
, backfitting
Examples
library(pgam)
data(aihrio)
attach(aihrio)
form <- ITRESP5~f(WEEK)+HOLIDAYS+rain+PM+g(tmpmax,7)+g(wet,3)
m <- pgam(form,aihrio,omega=.8,beta=.01,maxit=1e2,eps=1e-4,optim.method="BFGS")
summary(m)