Learn R Programming

VGAM (version 0.9-1)

setup.smart: Smart Prediction Setup

Description

Sets up smart prediction in one of two modes: "write" and "read".

Usage

setup.smart(mode.arg, smart.prediction = NULL, max.smart = 30)

Arguments

mode.arg
mode.arg must be "write" or "read". If in "read" mode then smart.prediction must be assigned the data structure .smart.prediction that was created while fitting. This is
smart.prediction
If in "read" mode then smart.prediction must be assigned the list of data dependent parameters, which is stored on the fitted object. Otherwise, smart.prediction is ignored.
max.smart
max.smart is the initial length of the list .smart.prediction. It is not important because .smart.prediction is made larger if needed.

Value

  • Nothing is returned.

Side Effects

In "write" mode .smart.prediction in smartpredenv (R) or frame 1 (S-PLUS) is assigned an empty list with max.smart components. In "read" mode .smart.prediction in smartpredenv (R) or frame 1 (S-PLUS) is assigned smart.prediction. In both cases, .smart.prediction.counter in smartpredenv (R) or frame 1 (S-PLUS) is assigned the value 0, and .smart.prediction.mode and .max.smart are written to smartpredenv (R) or frame 1 (S-PLUS) too.

Details

This function is only required by programmers writing a modelling function such as lm and glm, or a prediction functions of such, e.g., predict.lm. The function setup.smart operates by mimicking the operations of a first-in first-out stack (better known as a queue).

See Also

lm, predict.lm.

Examples

Run this code
# Put at the beginning of lm
setup.smart("write")

# Put at the beginning of predict.lm
setup.smart("read", smart.prediction=object$smart.prediction)

Run the code above in your browser using DataLab