Functions & Formulae

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

Deadweight loss of a wedge between marginal value and marginal cost

DWL = abs(integral_(q_star)^(q_d) (P(q) - MC(q)) dq)

Maps a price distortion, such as a tax, a subsidy, a price above cost or insurance that lowers the price at the point of use, to the net surplus it destroys: the value of trades it prevents in excess of their cost, or the cost of trades it adds in excess of their value. Money that only changes hands, such as tax revenue or an insurer's payments, is netted out. With straight-line curves the area is a triangle whose height is the wedge and whose base is the change in quantity. The notation follows the Deadweight Loss article.

  • Deadweight loss triangle from a price wedge and the quantity change it causes

    DWL = 0.5 * w * abs(q_d - q_star)

    Multiplies half the wedge between the demand price and the supply price at the distorted quantity by the change in quantity the wedge causes. For an excise tax the height is the tax per unit and the base the fall in sales; for insurance the height is the gap between the cost of care and the patient's price and the base the extra use. The coinsurance case written in terms of the coinsurance rate is HE-FM-MH-001.

  • Harberger approximation to deadweight loss from a small ad valorem tax

    DWL = 0.5 * eps * tau^2 * p * q

    Writes the triangle in terms of spending before the tax and the price elasticity of demand. With constant marginal cost the wedge is tau times p and quantity falls by about eps times tau times q, so the loss is half their product. Zero elasticity gives zero loss, and doubling the tax rate roughly quadruples it. The expression is the single-tax case of the second-order approximation that Auerbach and Hines attribute to Harberger, with the quantity response written through the elasticity.

  • Feldstein and Gruber reduction in the deadweight loss of insurance when coinsurance rises

    dDWL = (E_0 - E_1) * (1 - P_1) + 0.5 * (P_1 - P_0) * (E_0 - E_1)

    Measures the fall in the deadweight loss of insurance-induced care when the coinsurance rate rises from P_0 to P_1. Care is measured in units whose price without insurance is 1, so quantities are spending at full cost. The reduction is a rectangle, the forgone care times the gap between its cost and the new patient price, plus a triangle above it. With a constant elasticity eta, E_1 = E_0 * (P_0 / P_1)^eta, and the triangle term then treats demand as straight between E_1 and E_0, an approximation.

  • Social cost of tax-financed spending with a marginal excess burden of taxation

    C_adj = (1 + lambda) * G

    Scales an option's net call on tax-financed public budgets by one plus the marginal excess burden, the deadweight loss per unit of extra revenue at the margin; one plus it is the marginal cost of public funds. Guidance differs: the 1992 US OMB Circular A-94 takes 25 cents per dollar for a supplementary analysis, Norway's circular R-109/2021 sets 20 øre per krone for all sectors, and the UK Green Book (2026) says the costs of raising public funds should not generally be included.