Smart Prediction Setup
setup.smart.RdSets up smart prediction in one of two modes:
"write" and "read".
Arguments
- mode.arg
mode.argmust be"write"or"read". If in"read"mode thensmart.predictionmust be assigned the data structure.smart.predictionthat was created while fitting. This is stored inobject@smart.predictionorobject$smart.predictionwhereobjectis the name of the fitted object.- smart.prediction
If in
"read"mode thensmart.predictionmust be assigned the list of data dependent parameters, which is stored on the fitted object. Otherwise,smart.predictionis ignored.- max.smart
max.smartis the initial length of the list.smart.prediction. It is not important because.smart.predictionis made larger if needed.
Side Effects
In "write" mode
.smart.prediction in
smartpredenv
is assigned an empty list with max.smart components.
In "read" mode
.smart.prediction in
smartpredenv
is assigned smart.prediction.
Then
.smart.prediction.counter in
smartpredenv
is assigned the value 0, and
.smart.prediction.mode and .max.smart are written to
smartpredenv 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.