GAMBoost (version 1.2-3)

plot.GAMBoost: Plots of the smooth functions from a GAMBoost fit

Description

Generates plots for the smooth components from a GAMBoost fit at a specific boosting step.

Usage

"plot"(x,select=NULL,at.step=NULL,add=FALSE,phi=1,ylim=NULL,xlab=NULL,ylab=NULL,...)

Arguments

x
fitted GAMBoost object from a GAMBoost call.
select
indices of the smooth component(s) for which plots should be generated. If none are specified, all are used.
at.step
boosting step from which the estimates for the smooth functions should be evaluated. If not given, the final boosting step is used.
add
logical value indicating whether the plot(s) should be added to the current plot.
phi
scale parameter for the confidence bands.
ylim,xlab,ylab
standard plotting parameters for plotting range and axis labels. Automatically set if NULL.
...
miscellaneous plotting parameters given to the low level plotting routine.

Value

A plot is produced for the specified smooth components in the GAMBoost fit. Pointwise confidence bands are plotted when the standard error information has been calculated (option calc.se=TRUE in the call to GAMBoost).

Examples

Run this code
##  Generate some data 

x <- matrix(runif(100*8,min=-1,max=1),100,8)             
eta <- -0.5 + 2*x[,1] + 2*x[,3]^2
y <- rbinom(100,1,binomial()$linkinv(eta))

##  Fit the model with smooth components
gb1 <- GAMBoost(x,y,penalty=400,stepno=100,trace=TRUE,family=binomial()) 

##  Plot smooth components of fit

#   all, at final boosting step
par(mfrow=c(2,4))
plot(gb1)

#   components that received an update up to the 'optimal' boosting step

selected <- getGAMBoostSelected(gb1,at.step=which.min(gb1$AIC))

par(mfrow=c(1,length(selected$smooth)))
plot(gb1,select=selected$smooth)

#   components where the estimate at the 'optimal' boosting step does not
#   contain the null line
par(mfrow=c(1,length(selected$smoothbands)))
plot(gb1,select=selected$smoothbands)

Run the code above in your browser using DataLab