# Basic usage
alpha_objective(0.5, 1.2, c(0.2, 0.3, 0.5, 0.4))
# Example with uniroot:
fertility_rates <- c(0.2, 0.3, 0.5, 0.4)
beta <- 1.2
res <- uniroot(
alpha_objective,
interval = c(0.000001, 100),
beta = beta,
fertility_rates = fertility_rates
)
res$root
Run the code above in your browser using DataLab