plotbsSpline: plotbsSpline

View source: R/plot.bs.spline.r

plotbsSplineR Documentation

plotbsSpline

Description

Plot the results of fitting a temporal b-spline.

Usage

plotbsSpline(X, fit, beg.x, end.x, eff0, option, bd2, ...)

Arguments

X

The basis b-spline matrix resulting from a call to function bs.

fit

The generalized linear model resulting from a call to function glm.

beg.x

The POSIX-formatted start date to use for plotting.

end.x

The POSIX-formatted end date to use for plotting.

eff0

The default data frame containing efficiency trials for a particular TrapPositionID. Typically tmp.df.

option

The plotting option. Value option=1 incorporates logic surrounding spline knots, while option=2 does not.

bd2

The batchDate2 column, typically from data frame df, containing the batchDates mapped to the 1959-1960 spline paradigm.

...

Additional plotting control.

Details

Function plotbsSpline simply organizes all the pieces necessary to graph the prediction cubic piecewise polynomial resulting from the use of a b-spline. It plots not only the (necessarily) smooth spline, but also the original points used to estimate it. It also plots all knots, i.e., both boundary and interior. It calculates the prediction via matrix multiplication of the provided matrix basis X and the vector of parameter β coefficients from object fit.

This function is customized for use with the CAMP project, and will not work for splines derived from data originating elsewhere without modification.

Value

A plot of the fitted cubic spline, its originating data points, and the knots utilized to achive the fit.

Author(s)

WEST Inc.

See Also

F.efficiency.model.enh

Examples

## Not run: 
#   ---- Plot results from an efficiency model.  Note that no parameter
#   ---- is provided for argument bd2 (batchDate2).   
plotbsSpline(X,fit,beg.x,end.x,tmp.df)

## End(Not run)

tmcd82070/CAMP_RST documentation built on April 6, 2022, 12:07 a.m.