Skip to contents

Generic function for checking R objects which produces, for instance, convergence tests or diagnostic plots. For qgam objects check.qgam() will be used.

Usage

check(obj, ...)

Arguments

obj

the object to be checked.

...

extra arguments, mainly used by graphic functions.

Value

Reports the results of convergence tests and/or produces diagnostic plots.

Author

Matteo Fasiolo <matteo.fasiolo@gmail.com>.

Examples

#######
# Using check.qgam
#######
library(qgam)
set.seed(0)
dat <- gamSim(1, n=200)
#> Gu & Wahba 4 term additive model
b<-qgam(y~s(x0)+s(x1)+s(x2)+s(x3), data=dat, qu = 0.5)
#> Estimating learning rate. Each dot corresponds to a loss evaluation. 
#> qu = 0.5................done 
plot(b, pages=1)

check(b, pch=19, cex=.3) 


#> Theor. proportion of neg. resid.: 0.5   Actual proportion: 0.52
#> Integrated absolute bias |F(mu) - F(mu0)| = 0.04500293
#> Method: REML   Optimizer: outer newton
#> full convergence after 1 iteration.
#> Gradient range [-3.383768e-11,6.484147e-12]
#> (score 454.5317 & scale 1).
#> Hessian positive definite, eigenvalue range [0.0209528,2.626975].
#> Model rank =  37 / 37 
#> 
#> Basis dimension (k) check: if edf is close to k' (maximum possible edf) 
#> it might be worth increasing k. 
#> 
#>       k'  edf
#> s(x0)  9 2.75
#> s(x1)  9 2.58
#> s(x2)  9 7.44
#> s(x3)  9 1.21