Retrieve one component of the list .smart.prediction from smartpredenv.

get.smart()

Value

Returns with one list component of .smart.prediction from smartpredenv, in fact, .smart.prediction[[.smart.prediction.counter]]. The whole procedure mimics a first-in first-out stack (better known as a queue).

Side Effects

The variable .smart.prediction.counter in smartpredenv is incremented beforehand, and then written back to smartpredenv.

Details

get.smart is used in "read" mode within a smart function: it retrieves parameters saved at the time of fitting, and is used for prediction. get.smart is only used in smart functions such as sm.poly; get.smart.prediction is only used in modelling functions such as lm and glm. The function get.smart gets only a part of .smart.prediction whereas get.smart.prediction gets the entire .smart.prediction.

Examples

print(sm.min1)
#> function (x) 
#> {
#>     x <- x
#>     minx <- min(x)
#>     if (smart.mode.is("read")) {
#>         smart <- get.smart()
#>         minx <- smart$minx
#>     }
#>     else if (smart.mode.is("write")) 
#>         put.smart(list(minx = minx))
#>     minx
#> }
#> <bytecode: 0x56035d6c4720>
#> <environment: namespace:VGAM>
#> attr(,"smart")
#> [1] TRUE