% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fert.approx.R
\name{fert.approx}
\alias{fert.approx}
\title{Fertility models for ASFR approximation}
\usage{
fert.approx(fx, age, model, start = NULL, se = FALSE, alpha = 0.05, bn = 1000)
}
\arguments{
\item{fx}{Numeric vector of age specific fertility rates.}

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

\item{model}{Character. Model name to be estimated. Now "Hadwiger", "Gamma", "Brass" and "Beta" are supported.}

\item{start}{Numeric vector with user-specific values of parameters for optimization. Default is \code{NULL} (choose automatically)}

\item{se}{Logical. Should bootstrapped variance for ASFR approximation be calculated. Default is \code{FALSE} for no bootstrap.}

\item{alpha}{Numeric. Used if \code{se = TRUE}, the level of uncertainty. By default, \code{alpha = 0.05} for 95\% CI.}

\item{bn}{Numeric. Used if \code{se = TRUE}, number of bootstrap samples. By default, \code{bn = 1000}.}
}
\value{
A list with two components: \code{model}, a list describing the fitted
fertility model (\code{type}, fitted \code{params}, \code{rmse}, and, if \code{se = TRUE},
bootstrap \code{covmat} and parameter percentile intervals \code{prc}); and
\code{predicted}, a data frame with observed and fitted age-specific fertility
rates. When \code{se = TRUE}, \code{predicted} also includes bootstrap standard
errors and percentile intervals.
}
\description{
Fertility models for ASFR approximation
}
\details{
This function runs least squares optimization (using default \code{optim}) of the selected fertility function with 1e-06 as tolerance parameter.

\eqn{f_x} is age-specific fertility rate for age \eqn{x}.
\subsection{Hadwiger model}{

The model is as follows: \deqn{f_x = \frac{ab}{c} \frac{c}{x}^{3/2} exp[-b^2(\frac{c}{x}+\frac{x}{c}-2)]}
where \eqn{a,b,c} are estimated parameters that do not have demographic interpretation. Sometimes \eqn{c} is interpreted as mean age at childbearing.
}

\subsection{Gamma model}{

The model is as follows: \deqn{f_x = \frac{R}{\Gamma(b)c^b}(x-d)^{b-1} exp[-(\frac{x-d}{c})]}
where \eqn{R,b,c,d} are estimated parameters. \eqn{\Gamma} is gamma function. \eqn{R} can be interpreted as fertility level (TFR) and \eqn{d} as mean age at childbearing.
}

\subsection{Brass model}{

The model is as follows: \deqn{f_x = c(x-d)(d+w-x)}
where \eqn{c,d,w} are estimated parameters.
}

\subsection{Beta model}{

The model is as follows: \deqn{f_x = \frac{R}{B(A,C)}(\beta - \alpha)^{-(A+C-1)}(x-\alpha)^{(A-1)}(\beta-x)^{(B-1)}}
where \eqn{B(A, C)} is beta function, \eqn{R, \beta, \alpha} are estimated parameters, which can be interpreted as fertility level (TFR) and max and min age of childbearing respectively.
\eqn{A,C} are
\deqn{C = (\frac{(v - \alpha)(\beta - v)}{\tau^2} - 1)\frac{\beta - v}{\beta - \alpha}}
\deqn{A = C\frac{v-\alpha}{v - \beta}}
where \eqn{v, \tau^2} are estimated parameters, where \eqn{v} can be interpreted as mean age at childbearing. Thus, Beta model uses 5 parameters \eqn{R, \beta, \alpha, v, \tau^2}, where only \eqn{\tau^2} has no demographic interpretation.
}
}
\examples{
age <- seq(15, 45, 5)
fx <- c(0.03, 0.10, 0.14, 0.12, 0.07, 0.03, 0.01)
fert.approx(fx = fx, age = age, model = "Hadwiger", se = FALSE)
}
\references{
Peristera, P., & Kostaki, A. (2007). Modeling fertility in modern populations. \emph{Demographic Research}, \emph{16}, 141-194.
}
