← All projects

Live products

Actuworry

Price it. Reserve it. Stress it. Life insurance calculations in the browser, with no spreadsheet in sight.

Why it exists

Actuarial work is mostly mathematics, but the tools people reach for do not always show it. Excel struggles as soon as a model gets serious, enterprise platforms cost more than most students will ever see, and a lot of the logic ends up hidden behind a user interface.

Actuworry started as an answer to that frustration: a tool that simulates the kind of work insurers usually outsource, such as pricing, reserving and forecasting, where every assumption is visible and the code can be read. The original story is in the post Spreadsheets Shouldn't Be That Hard.

It is built for the Botswana market, with calculations in BWP.

What you can do with it

The live app is organised into focused tools, each one a tab:

  • Premium. Price term life, whole life, immediate annuities and deferred annuities from a policy's age, sex, smoker status, health and sum assured. Expenses, profit margin and an annuity loading are all editable, and a rating factor can override the defaults. The result shows net, gross and monthly premiums with the expense breakdown, plus a reserve schedule.
  • Valuation. Present value of a future amount, and a deferred annuity calculator.
  • Reserves. The reserve at any policy year, shown prospectively with the retrospective check beside it.
  • Monte Carlo. Simulate interest-rate paths and read the loss distribution, including mean, standard deviation, VaR and CTE at 95 and 99 percent.
  • Risk. Paste in a list of losses and see the tail highlighted, with the same risk measures.
  • Rates. Convert between nominal rates, effective annual rates and the force of interest, across compounding frequencies.
  • API. A built-in explorer that sends live JSON requests to the same endpoints.

The method

Premiums use the equivalence principle: the premium is set so that the expected present value of premiums equals the expected present value of benefits. Gross premiums then add expenses and a profit margin on top of the net premium.

Reserves are calculated prospectively, as the expected present value of future benefits less future premiums, and checked against a retrospective calculation. Simulation and risk measures use V-STAR, my Go actuarial engine, which is why Actuworry works as a front end to it as well as a tool in its own right.

Data and assumptions

This is the part that deserves plain language. The demo uses the UK National Life Tables 2021 to 2023 from the Office for National Statistics as its reference mortality basis. It is not Botswana-specific experience.

That makes the app a good way to learn and to explore how each assumption moves a result, and the wrong place to take a commercial decision. Every result is an illustration, and the app says so. A data and assumptions panel inside the app lists the tables that are loaded and each calculation basis.

How it is built

The backend is written in Go and the frontend is static HTML, CSS and JavaScript with no build step. The Go project separates the calculation engine, the mortality data (kept as CSV files), the HTTP handlers and the route definitions, so the actuarial logic can be tested without a server.

backend/actuarial/   calculation engine
backend/data/        mortality tables (CSV)
backend/handlers/    HTTP handlers
backend/routes/      route definitions
frontend/            index.html, css/style.css, js/app.js
main.go              server entry point

Everything the interface does goes through a JSON API, which is also documented and usable on its own:

MethodEndpointPurpose
POST/api/calculatePremium and reserve schedule for a single policy
POST/api/calculate/batchPremiums for a batch of policies
POST/api/calculate/sensitivityInterest, age and coverage sensitivity
POST/api/analyze/portfolioPortfolio summary
GET/api/tablesMortality tables that are loaded
POST/api/vstar/montecarloMonte Carlo loss distribution
POST/api/vstar/riskValue at risk and conditional tail expectation
POST/api/vstar/rate-convertNominal, effective and force of interest
POST/api/vstar/reserve-retroRetrospective reserve at a policy year
GET/api/healthHealth check
curl -X POST http://localhost:8080/api/calculate \
  -H "Content-Type: application/json" \
  -d '{"age":35,"term":20,"sum_assured":100000,"interest_rate":0.05,"table_name":"male","product_type":"term_life"}'

Run it yourself

It needs Go 1.26 or later. Clone the repository, run make run and open localhost:8080. make test runs the Go tests.

Where it fits

Actuworry and V-STAR are two halves of the same idea. V-STAR is the engine, built to be fast and inspectable. Actuworry is the product on top of it, built to make those calculations approachable for someone who has never opened a Go file.

Hand-siphon for Greek fire, medieval illumination

ABOUT THE IMAGE

Hand-siphon for Greek fire, medieval illumination

Date
9th or 11th century AD
Rights
Public domain claim (jurisdiction may vary)

Historical context

This manuscript illustration shows a hand-siphon firing Greek fire from a siege tower towards defenders on a wall. It belongs to the Byzantine military-technology tradition; the source identifies the manuscript as Codex Vaticanus Graecus 1605, but its dating is uncertain.

View original source and rights ↗

The article cover is a cropped, tinted adaptation of this image.