Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fitted.fitStMoMo

Compute fitted values for a Stochastic Mortality Model


Description

Returns fitted values for the data used in fitting a Stochastic Mortality Model.

Usage

## S3 method for class 'fitStMoMo'
fitted(object, type = c("link", "rates", "deaths"), ...)

Arguments

object

an object of class "fitStMoMo" with the fitted parameters of a stochastic mortality model.

type

the type of the fitted values that should be returned. The alternatives are "link"(default), "rates", and "deaths".

...

other arguments.

Value

A matrix with the fitted values.

Examples

LCfit <- fit(lc(), data = EWMaleData, ages.fit = 55:89)
matplot(LCfit$ages, fitted(LCfit), type = "l", lty = 1, 
        col = rainbow(length(LCfit$years)), xlab = "year", 
        ylab = "log death rate", main = "Fitted rates")

uxthat <- fitted(LCfit, type = "rates")
uxt <- LCfit$Dxt / LCfit$Ext
plot(LCfit$years, uxt["65", ], xlab = "year", ylab = "death rate",
     main = "fitted vs. observed rates at age 65")
lines(LCfit$years, uxthat["65", ])

StMoMo

Stochastic Mortality Modelling

v0.4.1
GPL (>= 2)
Authors
Andres Villegas <andresmauriciovillegas@gmail.com>, Pietro Millossovich <Pietro.Millossovich.1@city.ac.uk>, Vladimir Kaishev <Vladimir.Kaishev.1@city.ac.uk>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.