Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Endemic vaccination externality function from coverage at birth to infection risk, benefit split and voluntary uptake

e(R_0, v, L, c) = (pi, n, MPB, MEB, v_vol)

Maps the basic reproduction number R_0 of an endemic infection, the share v of each birth cohort vaccinated at birth, the loss L per infection and the private cost c of one vaccination to the lifetime infection risk of an unvaccinated child and the infections per birth (HE-FM-VEXT-001), the private and external benefit of one more vaccination (HE-FM-VEXT-002) and the coverage that voluntary uptake reaches (HE-FM-VEXT-003), all in the long-run steady state of an SIR model with births and deaths. The marginal social benefit as marginal private plus marginal external benefit is HE-FM-EXT-001, the herd immunity threshold H = 1 minus 1/R_0 is HE-FM-BRN-003 and the effective reproduction number is HE-FM-BRN-002, so none of them is restated here; the Pigouvian vaccination subsidy with linear curves is HE-FM-EXT-002, with its bill and net welfare under HE-FN-PIGS-001. The article's social cost per 1,000 births, GBP 250,000 under voluntary uptake, GBP 212,500 under free provision and GBP 200,000 at the threshold, is 1,000 times the expected cost per birth at a chance node, HE-FM-CHN-001, with a vaccinated branch of probability v costing the full resource cost of a vaccination whoever pays it and an unvaccinated branch of probability 1 minus v costing the expected loss L times pi from HE-FM-VEXT-001, so it is not drafted as a formula. The lifetime chance lambda/(lambda + mu) of infection before death is the long-horizon limit of the competing-hazards record HE-FM-TP-004, the final size of a closed epidemic is HE-CF-ATR-001 and vaccine effectiveness from attack rates is HE-FM-ATR-004. Notation follows the Vaccination Externalities article.

  • Lifetime infection risk of an unvaccinated child and infections per birth in an endemic infection with vaccination at birth

    pi = max(0, 1 - 1 / (R_0 * (1 - v))); n = (1 - v) * pi

    In an endemic infection with lifelong immunity, births and deaths at rate mu and a share v of each birth cohort given a fully protective vaccine at birth, the susceptible share settles at 1/R_0 while the infection persists, so the force of infection lambda settles where the unvaccinated births mu(1 minus v) balance the outflow (lambda + mu)/R_0 from the susceptible pool. An unvaccinated child then leaves the susceptible state by infection or by death, and its lifetime chance of infection lambda/(lambda + mu), the long-horizon limit of HE-FM-TP-004 (derived), becomes pi = 1 minus 1/(R_0(1 minus v)), Eq. 15 of Bauch and Earn and equation (15) of Goodkin-Gold and colleagues, which falls as coverage rises and is zero at or above the threshold H of HE-FM-BRN-003. The same expression is 1 minus 1/R_t with R_t = R_0(1 minus v) from HE-FM-BRN-002 (derived), but HE-FM-BRN-003 is defined for the basic reproduction number and returns an immune share, not a probability of infection. Infections per birth n are the unvaccinated share times that risk, the pathway probability of HE-FM-CHN-002 with factors 1 minus v and pi, which equals (1 minus v) minus 1/R_0 below H (derived from the endemic infected share in Eq. 14 of Bauch and Earn), so each extra vaccination below H removes exactly one infection in total; the share infected in a closed epidemic without births is the final size of HE-CF-ATR-001, a different quantity.

  • Private and external benefit of one vaccination at a given coverage in an endemic infection

    pi = max(0, 1 - 1 / (R_0 * (1 - v))); MPB = L * pi; MEB = (v < 1 - 1 / R_0) * L / (R_0 * (1 - v))

    Splits the value of one more vaccination at coverage v, with a loss L per infection valued the same by the family and by society, into the marginal private benefit to the vaccinated child, L times the lifetime risk pi it avoids (the expected value of HE-FM-CHN-001 with branch values L and 0), and the marginal external benefit to unvaccinated children, L/(R_0(1 minus v)), which is L times 1 minus pi below the threshold H and zero at or above it. Below H the two add to L, because each extra vaccination there removes exactly one infection in total (HE-FM-VEXT-001), so the marginal social benefit of HE-FM-EXT-001 stays at L while its split moves towards the external side as coverage rises (derived). Goodkin-Gold and colleagues derive the same split, the marginal private benefit theta H Phi_I, the marginal social benefit theta H and the marginal externality theta H/((1 minus theta Q/mu) R_0) below the eradication quantity and zero above it, with theta of 1 and Q/mu equal to v for a fully protective vaccine. The external share is 0.5 at the article's 60% coverage and 0.8 at 75%, so a subsidy set at the marginal external benefit, as in HE-FM-EXT-002 with linear curves, depends on the coverage at which that benefit is read.

  • Coverage reached by voluntary vaccination when families weigh private cost against expected loss from infection

    r = c / L; v_vol = 1 - 1 / (R_0 * max(1 - r, 1 / R_0))

    A family that bears a private cost c per vaccination, counting any price and its own time and travel, and expects a loss L if the child is infected vaccinates while L times pi exceeds c, so in a homogeneous population uptake settles where the unvaccinated child's lifetime risk equals r = c/L. Solving pi(v) = r with HE-FM-VEXT-001 gives v_vol = 1 minus 1/(R_0(1 minus r)), the convergently stable Nash equilibrium P* of Bauch and Earn's vaccination game with r read as their relative risk r_v/r_i, and, with P/(theta H) equal to r, theta times d(P)/mu, the share immunised under the demand d(P) of Goodkin-Gold and colleagues, which for a fully protective vaccine is the share vaccinated. When r is at least the risk with no vaccination, 1 minus 1/R_0, nobody vaccinates, and writing max(1 minus r, 1/R_0) in the denominator returns that 0 and avoids a division by zero for r of 1 or more (derived; it equals the piecewise result on a grid of R_0 and r). For any r above zero v_vol is below the threshold H of HE-FM-BRN-003, Bauch and Earn's result that voluntary vaccination cannot eradicate the disease, and free provision lowers c and raises v_vol without reaching H while any private cost remains.