predict.WH_2d {WH} | R Documentation |
Prediction for a Whittaker-Henderson Fit
Description
Extrapolate the Whittaker-Henderson fit for new observations in a way that is consistent with the initial model fit.
Usage
## S3 method for class 'WH_2d'
predict(object, newdata = NULL, ...)
Arguments
object |
An object of class |
newdata |
A list containing two vectors indicating the new observation positions |
... |
Not used |
Value
An object of class "WH_2d"
with additional components y_pred
and
std_y_pred
corresponding to the model predictions and associated standard
deviations.
Examples
keep_age <- which(rowSums(portfolio_LTC$ec) > 5e2)
keep_duration <- which(colSums(portfolio_LTC$ec) > 1e3)
d <- portfolio_LTC$d[keep_age, keep_duration]
ec <- portfolio_LTC$ec[keep_age, keep_duration]
fit <- WH_2d(d, ec)
newdata <- list(age = 50:99, duration = 0:19)
pred <- predict(fit, newdata)
plot(pred)
[Package WH version 1.1.1 Index]