Evaluates a fitted mortality law at new ages. The coefficients are reused
as they are, so the prediction is an extrapolation of the fitted curve:
it is meaningful over the ages that the law describes and becomes
unreliable far outside the fitted range. Models that scale the age vector
during fitting (the SCALE_X column of availableLaws)
are rescaled internally, so the prediction stays consistent with the
coefficients.
Usage
# S3 method for class 'MortalityLaw'
predict(object, x, ...)Value
A named vector of predicted mortality values for a single fit, or
a matrix with one column per fit. The values are hazards
(mu[x]) or death probabilities (q[x]), depending on the
law; see the FIT column of availableLaws.
Examples
# Extrapolate old-age mortality with the Kannisto model
# Fit ages 80-94 and extrapolate up to 120.
Mx <- ahmd$mx[paste(80:94), "1950"]
M1 <- MortalityLaw(x = 80:94, mx = Mx, law = 'kannisto')
fitted(M1)
#> 80 81 82 83 84 85 86 87
#> 0.1065943 0.1174811 0.1293189 0.1421574 0.1560420 0.1710123 0.1871005 0.2043292
#> 88 89 90 91 92 93 94
#> 0.2227097 0.2422402 0.2629042 0.2846687 0.3074833 0.3312796 0.3559709
predict(M1, x = 80:120)
#> 80 81 82 83 84 85 86 87
#> 0.1065943 0.1174811 0.1293189 0.1421574 0.1560420 0.1710123 0.1871005 0.2043292
#> 88 89 90 91 92 93 94 95
#> 0.2227097 0.2422402 0.2629042 0.2846687 0.3074833 0.3312796 0.3559709 0.3814527
#> 96 97 98 99 100 101 102 103
#> 0.4076042 0.4342897 0.4613617 0.4886635 0.5160331 0.5433069 0.5703235 0.5969275
#> 104 105 106 107 108 109 110 111
#> 0.6229733 0.6483276 0.6728721 0.6965056 0.7191442 0.7407229 0.7611941 0.7805279
#> 112 113 114 115 116 117 118 119
#> 0.7987104 0.8157421 0.8316365 0.8464180 0.8601200 0.8727833 0.8844542 0.8951830
#> 120
#> 0.9050225
# See more examples in MortalityLaw function help page.