| setup.smart {VGAM} | R Documentation |
Sets up smart prediction in one of two modes:
"write" and "read".
setup.smart(mode.arg, smart.prediction = NULL, max.smart = 30)
mode.arg |
|
smart.prediction |
If in |
max.smart |
|
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).
Nothing is returned.
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.
lm,
predict.lm.
## Not run: # Put at the beginning of lm
setup.smart("write")
## End(Not run)
## Not run: # Put at the beginning of predict.lm
setup.smart("read", smart.prediction=object$smart.prediction)
## End(Not run)