Pólya Regression: Forecasting Accidents | Vose Software

ModelRisk example · General techniques

Pólya Regression Fitted to Accident Data

How many sports accidents next year, and the two after? A Pólya regression fitted to sixteen years of data.

  • Complexity: ★★★★★
  • Free Excel workbook (GU-10)
  • Needs ModelRisk: free trial

From the model’s saved run

Accidents in the next three years

With the fitted parameters, and with their uncertainty included.

MeasureUnit10th pctMedian90th pctMean
Year 1, fitted parametersaccidents6521,1831,9391,253
Year 1, with parameter uncertaintyaccidents5961,1702,1221,287
Year 2, fitted parametersaccidents6621,2222,0021,292
Year 2, with parameter uncertaintyaccidents6161,2162,1891,336
Year 3, fitted parametersaccidents6961,2532,0731,330
Year 3, with parameter uncertaintyaccidents6141,2382,2771,368
MeasureUnitValue
Standard deviation, year 3, fitted parametersaccidents554
Standard deviation, year 3, with parameter uncertaintyaccidents702
Year 3 — accidents

The business question

A health authority records sports accidents each year. Over sixteen years they have grown from about 650 to about 1,400, with large swings from year to year: far more than a Poisson process would give. A Pólya regression describes them: the expected number grows exponentially, exp(β0 + β1·year), and each year's count scatters around it with extra variation h.

The parameters were fitted by maximising the log-likelihood with Excel's Solver. The authority wants the next three years. Projecting with the fitted parameters alone treats the trend as known. With sixteen noisy years it is not, and the model shows how much that widens the forecast.

Who it is for
Analysts forecasting overdispersed counts from a short history: claims, accidents, incidents, demand.
Main outputs
Accidents in each of the next three years at P10 / median / P90, with the fitted parameters and with their uncertainty · the fitted trend and its standard error · a check that the stored fit is the maximum.

How the model works

Four sheets after this one, read from left to right. Each one feeds the next.

  1. Inputs sheet

    β0 (the log of the expected accidents in year 0), β1 (the growth per year on the log scale) and h, as fitted by Solver.

  2. History sheet

    Expected accidents each year, each year's log-likelihood (VosePolyaProb10), and their total, which the fitted parameters maximise. The score (the slope of the log-likelihood) is about 0 at the maximum, which a check confirms.

  3. Forecast sheet

    The information matrix, built from the History sheet's weights, gives the covariance of β0 and β1. With fixed parameters each year is VosePolya(1/h, λh). With parameter uncertainty, β0 and β1 are first drawn from their correlated normal distribution (two VoseNormal draws through a Cholesky factor), and λ follows from them.

  4. Results sheet

    Percentiles of each year's accidents both ways, the fitted trend with its standard error, and the chart of the history and the fit.

ModelRisk techniques

  • Pólya regression VosePolya
  • Log-likelihood VosePolyaProb10
  • Score check of the fit
  • Parameter uncertainty in the projection

Find similar models

Product

The results in detail

The fitted trend

From the History sheet: the maximum-likelihood fit and its standard error.

MeasureUnitValue
Growth per year, fitted (exp(β1) − 1)per year3.0%
Growth per year, minus 2 standard errorsper year−1.6%
Growth per year, plus 2 standard errorsper year7.8%
Log-likelihood at the fitln−117.90

How to read these results

  • The fitted trend is about 3% growth a year, but sixteen noisy years pin it down poorly: within two standard errors it could be anything from a small decline to about 8% growth a year.
  • With the fitted parameters, the forecast's spread is the Pólya scatter alone. Including the uncertainty in β0 and β1 widens it: the 90th percentile of year 3 moves up by about 200 accidents and the standard deviation by about a quarter, and the difference grows with every year projected.
  • The year-to-year scatter is still the larger part of the uncertainty: h = 0.17 means a year's standard deviation is about 40% of its expected value.
  • After adding data, refit with Solver (maximise the log-likelihood on the History sheet by changing β0, β1 and h on the Inputs sheet). The score check confirms that the stored parameters are at the maximum.

See it move. Open the workbook, change an input on the Inputs sheet and run the simulation: every table and chart on this page updates in Excel.

Inputs and assumptions

Every assumption in the model, with its uncertainty and where it comes from. The figures are illustrative.

The fitted Pólya regression 3 inputs

Maximum-likelihood estimates, fitted with Excel's Solver on the History sheet.

AssumptionUnitValue
β0 (log of the expected accidents in year 0)exp(β0) ≈ 1,215 accidents.7.101927
β1 (growth per year, log scale)About 3% a year.0.029449
h (extra variation)A year's variance = λ + hλ².0.174214

Units and conventions

Year
Year 0 is the last year of data; years 1 to 3 are forecast.
Pólya
VosePolya(α, β) is a Poisson with a Gamma(α, β) mean: here α = 1/h and β = λh, so the mean is λ and the variance λ + hλ².
Log scale
β1 = 0.029 means about 3% growth a year: exp(β1) − 1.

Key assumptions and limitations

Trend
Exponential in the year, as in the original example.
Independence
Years are independent given the trend.
Parameter uncertainty
Approximately normal around the fit (large-sample theory); h is taken as known, which affects only the year-to-year scatter.
Data
The accident counts and the fitted parameters are those of ModelRisk's earlier Polya Regression example.

How to use it

  1. Replace the history on the History sheet with your own counts.
  2. Refit: run Solver to maximise the log-likelihood by changing β0, β1 and h on the Inputs sheet. The score check reads OK at the maximum.
  3. Run a simulation from the ModelRisk ribbon (10,000 samples with a fixed seed are set).
  4. Use the forecast with parameter uncertainty: the history is short.

ModelRisk functions used

VosePolyaProb10
Each year's log-likelihood (base 10), converted to natural logs.
VosePolya
Each forecast year's accidents: a Gamma-mixed Poisson with mean λ.
VoseNormal
The two standard normal draws behind the uncertain β0 and β1.
VoseOutput
The forecast years as output ranges, both ways.
VoseSimPercentile, VoseSimStdev
Statistics of the simulation.

Further reading

  • Monte Carlo simulation explained (Vose guide)
  • Cameron, A. C. and Trivedi, P. K. (2013). Regression Analysis of Count Data, 2nd edition. Cambridge University Press: the negative binomial (NB2) model.
  • Vose, D. (2008). Risk Analysis: A Quantitative Guide, 3rd edition. Wiley: parameter uncertainty in fitted models.