Learn R Programming

MortalityLaws (version 2.2.0)

scale_x: Scale the age vector for stable optimisation

Description

For mortality laws that cover only a portion of the lifespan (e.g., adult or old-age mortality), the age vector is rescaled so that the minimum age becomes 1. This improves numerical stability by keeping the exponentiated terms in the hazard function within a reasonable range.

Usage

scale_x(x)

Value

A numeric vector of scaled ages, where min(x) == 1.

Arguments

x

A numeric vector of ages.