scair
fitsThis function obtains predictions from a fitted scair
object.
# S3 method for scair
predict(object, newdata, type = c("link", "response"), rule=1, ...)
A fitted scair
object produced by scair
.
An optional numeric matrix
of \(d\) columns, with each row
specifying a location at which prediction is required. This argument can be
missing, in which case predictions are made at the same values of the
covariates used to compute the object.
Type of predictions, with choices "link" (the default), or "response". The default produces predictions on the scale of the index predictors. If "response" is selected, the predictions are on the scale of the response (i.e. mean of the exponential family), and are monotone transformations of the index predictors using the inverse link function.
An integer describing how to handle the new data outside the range of the
observed indices (computed via linear combination of observed covariates).
If rule=1
, then we use linear interpolation to get
the value of each fitted component function outside the range of observed
covariates. Otherwise if rule=2
, then the value at the closest data
extreme is used. Note that if there is convex/concave component, the choice of
the first rule can lead to somewhat unsatifactary performance
on/outside the "boundary" of the data (when comparing to the second rule).
Further arguments passed to or from other methods.
A numeric vector of predictions.
# NOT RUN {
## See examples for the function scair
# }
Run the code above in your browser using DataLab