Learn R Programming

WH (version 1.1.2)

plot.WH_2d: Plot Method for a Whittaker-Henderson Fit

Description

Plot Method for a Whittaker-Henderson Fit

Usage

# S3 method for WH_2d
plot(x, what = "y_hat", trans, ...)

Value

A plot representing the desired element from the fit...

Arguments

x

An object of class "WH_2d" returned by the WH_2d() function

what

Should be one of y_hat (the default) for model fit, std_y_hat for the associated standard deviation, res for residuals and edf for the effective degrees of freedom.

trans

An (optional) transformation to be applied to the data. By default the identity function

...

Not used

Examples

Run this code
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)
plot(fit)
plot(fit, "std_y_hat")

Run the code above in your browser using DataLab