residuals.pgam {pgam} | R Documentation |
Residuals extraction
Description
Method for residuals extraction.
Usage
## S3 method for class 'pgam'
residuals(object, type = "deviance", ...)
Arguments
object |
object of class |
type |
type of residuals to be extracted. Default is |
... |
further arguments passed to method |
Details
The types of residuals available and a brief description are the following:
response
These are raw residuals of the form .
pearson
Pearson residuals are quite known and for this model they take the form .
deviance
Deviance residuals are estimated by , where
is the deviance contribution of the t-th observation. See
deviance.pgam
for details on deviance component estimation.
std_deviance
Same as deviance, but the deviance component is divided by , where
is the t-th element of the diagonal of the pseudo hat matrix of the approximating linear model. So they turn into
.
The element has the form
, where
is the predictor of the approximating linear model.
std_scl_deviance
Just like the last one except for the dispersion parameter in its expression, so they have the form , where
is the estimated dispersion parameter of the model. See
summary.pgam
for estimation.
Value
Vector of residuals of the model fitted.
Author(s)
Washington Leite Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br
References
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
Junger, W. L. (2004) Semiparametric Poisson-Gamma models: a roughness penalty approach. MSc Dissertation. Rio de Janeiro, PUC-Rio, Department of Electrical Engineering.
McCullagh, P., Nelder, J. A. (1989). Generalized Linear Models. Chapman and Hall, 2nd edition, London
Pierce, D. A., Schafer, D. W. (1986) Residuals in generalized linear models. Journal of the American Statistical Association, 81(396),977-986
See Also
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")
r <- resid(m,"pearson")
plot(r)