Learn R Programming

StablePopulation (version 1.0.3)

find_alphas: Function to find the value of alpha

Description

This function finds the value of alpha using the uniroot method for a given beta and a vector of fertility rates. If the function values at the interval ends do not have opposite signs, it returns the closest value to 0.

Usage

find_alphas(beta, fertility_rates, tol = 1e-22)

Value

A numeric value giving the estimated value of alpha, either found by uniroot or selected as the endpoint closest to zero if the root is not bracketed.

Arguments

beta

A numeric value representing the beta parameter of Weibull distribution.

fertility_rates

A numeric vector containing the fertility rates.

tol

A numeric value representing the tolerance for the uniroot method. Default is 1e-22.

Examples

Run this code
find_alphas(1.2, c(0.2, 0.3, 0.5, 0.4))

Run the code above in your browser using DataLab