Learn R Programming

StablePopulation (version 1.0.3)

calculate_population: Calculates the population for each age group

Description

This function calculates the population for each age group and the number of births.

Usage

calculate_population(alpha, beta, fertility_rates)

Value

A list with the following elements:

population

A numeric vector giving the population size for each age group.

births

A numeric value giving the total number of births.

Arguments

alpha

A numeric value representing the scale parameter (\(\alpha\)) of the Weibull distribution. Note: In this context, alpha controls the horizontal scaling of the survival curve.

beta

A numeric value representing the shape parameter (\(\beta\)) of the Weibull distribution. Note: Beta controls the shape of the survival curve (e.g., aging or failure rate).

fertility_rates

A vector of fertility rates for each age group.

Examples

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

Run the code above in your browser using DataLab