scam.check {scam}R Documentation

Some diagnostics for a fitted scam object

Description

Takes a fitted scam object produced by scam() and produces some diagnostic information about the fitting procedure and results. This function is almost the same as gam.check of the mgcv library. The default is to produce four residual plots and some information about the convergence of the smoothness selection optimization.

Usage

scam.check(b,type=c("deviance","pearson","response"),old.style=FALSE, pch=".",
                       rep=0, level=.9, rl.col=3, rep.col="gray80",...)

Arguments

b

a fitted scam object as produced by scam().

old.style

produces qq-norm plots as it was in scam versions < 1.2-15 when set to TRUE.

type

type of residuals, see residuals.scam, used in all plots.

rep, level, rep.col

arguments passed to qq.scam() when old.style is FALSE (default).

rl.col

color for the reference line on the quantile-quantile plot.

pch

plot character to use for the quantile-quantile plot.

...

extra graphics parameters to pass to plotting functions.

Details

As for mgcv(gam) plots 4 standard diagnostic plots, and some other convergence diagnostics. The printed information relates to the optimization process used to select smoothing parameters.

Author(s)

Natalya Pya nat.pya@gmail.com based partly on mgcv by Simon N Wood

References

Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.

See Also

scam

Examples

 ## Not run: 
library(scam)
set.seed(2)
n <- 200
x1 <- runif(n)*4-1;
f1 <- exp(4*x1)/(1+exp(4*x1)) # monotone increasing smooth
x2 <- runif(n)*3-1;
f2 <- exp(-3*x2)/15  # monotone decreasing and convex smooth
f <- f1+f2
y <- f+ rnorm(n)*0.2
dat <- data.frame(x1=x1,x2=x2,y=y)
b <- scam(y~ s(x1,k=25,bs="mpi",m=2)+s(x2,k=25,bs="mdcx",m=2),
    family=gaussian(link="identity"),data=dat)
plot(b,pages=1)
scam.check(b)
 
## End(Not run)

[Package scam version 1.2-17 Index]