% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mort.approx.R
\name{mort.approx}
\alias{mort.approx}
\title{Mortality models for mx approximation}
\usage{
mort.approx(mx, age, model = c("Brass", "Gompertz"), standard.mx = NULL, ...)
}
\arguments{
\item{mx}{Numeric vector of age specific mortality rates.}

\item{age}{Numeric vector of ages.}

\item{model}{Character. Model name to be estimated. Now "Gompertz" and "Brass" are supported.}

\item{standard.mx}{Numeric vector of age specific mortality rates for standard population. Default is \code{NULL}.}

\item{...}{Used only for \code{Brass} model. Other parameters for the function \code{\link[=LT]{LT()}} including \code{ax} (by default, the middle of the interval), \code{sex} (by default = \code{"m"} - males), \code{l0} (by default = 1).}
}
\value{
A list with two components: \code{model}, the fitted \code{lm} or \code{nls}
object; and \code{predicted}, a data frame with columns \code{age} and \code{mx.pred}
containing the fitted mortality schedule.
}
\description{
Mortality models for mx approximation
}
\details{
This function runs least squares optimization of the selected mortality function using Gauss-Newton algorithm algorithm with 2000 maximum iterations
and 1e-07 as tolerance parameter. For "Gompertz" usual OLS estimator is used.
\subsection{Gompertz model}{

The model is as follows: \deqn{m(age) = \alpha e^{\beta age}}
}

\subsection{Brass model}{

The model is as follows: \deqn{y(age) = \alpha + \beta y^{S}(age)}
where \deqn{y(age) = \frac{1}{2} ln[\frac{q(age)}{1-q(age)}]}
and subscript S defines that function is for standard population. To get mx from qx usual formula is used:
\deqn{m(age) = \frac{q(age)}{n-q(age)(n-a(age))}} where n is the size of age interval and a(x) is a parameter from life table.
}
}
\examples{
age <- seq(40, 80, 10)
mx <- c(0.003, 0.005, 0.009, 0.018, 0.036)
standard.mx <- c(0.0025, 0.004, 0.007, 0.014, 0.03)
mort.approx(mx = mx, age = age, model = "Gompertz")
mort.approx(mx = mx, age = age, model = "Brass", standard.mx = standard.mx)
}
\references{
Preston, S. H., Heuveline, P., & Guillot, M. (2001). Demography: Measuring and Modeling Population Processes. Blackwell Publishers.
}
