17
Speed Limits, Accidents and Assignment Mike Maher University College London ITS Leeds, 12 December 2016

Speed limits accidents and assignment

Embed Size (px)

Citation preview

Page 1: Speed limits accidents and assignment

Speed Limits, Accidents and

Assignment

Mike Maher

University College London

ITS Leeds, 12 December 2016

Page 2: Speed limits accidents and assignment

Overview of the talk

• Describing two pieces of recent work

• First: two projects on speed limits

– effect of 20 mph speed limits

– effect on accidents of increase in HGV speed limits

– both being carried out by Atkins

– both being done for DfT

– my role is providing statistical analysis guidance

– no data as yet on 20 mph limits

• Second: a novel assignment problem

– but not as we generally know it!

Page 3: Speed limits accidents and assignment
Page 4: Speed limits accidents and assignment

HGV speed limit increase

• Increases came into force at start of April 2015

• From 40mph to 50 mph on single carriageways ..

• .. and from 50mph to 60mph on duals

• DfT want to know if any impact on accidents

• Quarterly accident data on affected roads

– for 10 years before the change ..

– .. and then up to three years after

• So far only data for two quarters after

– so just an illustration of what is to be done

– and the modelling to be applied

Page 5: Speed limits accidents and assignment

Time series model (1)

• average 400 accs / month

• average 100 FSCs / month

• 41 obs’ns before

• Clear trend and seasonality

• Fit SARIMA model

• Use auto.arima function in R

• d = 1, D = 1

• AR(1) term

log(all accidents)

actual (blue), fitted (red)

Page 6: Speed limits accidents and assignment

Time series model (2)

• Then fit an intervention model

– using all quarterly data (43 observations)

– include a regressor variable: before / after dummy

– = 0 in before period, and = 1 in after period

– coefficient β estimates step change in mean of log(accidents) following speed limit increase

– allowing for trend and seasonality

– so β < 0 implies a reduction in accidents

– accident rate then factored by exp(β)

Page 7: Speed limits accidents and assignment

Results

• All accidents

– 𝛽 = -0.276 (se = 0.088), so a reduction in accidents

– 95% CI on change: (-36%, -10%)

• FSCs

– 𝛽 = -0.212 (se = 0.110), so a reduction in FSCs

– 95% CI on change: (-35%, 0%)

• But clearly very limited amount of after data so far

– further work to be done in early 2017

Page 8: Speed limits accidents and assignment
Page 9: Speed limits accidents and assignment

Tennis assignment problem

• Midweek men’s doubles group in North Berwick

– around 20 men: retired, semi-retired etc

– each lets me know when available next week ..

– .. and how much they’d like / be willing to play

– pattern changes from week to week

– I put together the groups of four (or eight)

– maximise number of matches, satisfying the constraints

• Used to do it manually: pen and paper

– but wrote an algorithm to automate the process

– integer linear programming problem

– makes it easier for me and fair to everyone

– article in June issue of Mathematics Today

Page 10: Speed limits accidents and assignment

Names Mon Tues Wed Thurs Fri Times

Barry T 0 0 1 1 0 2

Tom B 1 1 0 1 0 3

Gordon B 0 0 0 0 1 1

Peter W 1 1 0 0 0 2

Colin C 1 0 0 1 0 2

Mike M 0 1 1 1 1 3

Keith I 0 1 1 0 0 1

Alan C 1 0 0 1 0 2

John S 0 1 0 0 0 1

Keith B 1 0 1 0 0 2

George StC 1 1 1 1 0 1

Michael L 0 0 1 0 0 1

Phil M 0 1 0 0 0 1

Brian F 1 1 0 0 0 2

Peter K 0 1 0 1 0 2

Willie McM 0 0 0 1 0 1

Ken L 0 1 0 0 0 1

Availability matrix: A

Page 11: Speed limits accidents and assignment

The basic model

Solve in R using the MILP solver lp (part of the lpSolve package)

Generally, many equally-optimal solutions

𝑥𝑖𝑗 = 1 if man 𝑖 plays on day 𝑗 and if 𝐴𝑖𝑗 = 1

𝑔𝑗 = number of 4 − man groups on day 𝑗

𝑗𝑥𝑖𝑗 ≤ 𝑇𝑖 ∀ 𝑖

𝑖𝑥𝑖𝑗 − 4𝑔𝑗 = 0 ∀ 𝑗

Maximise 𝑧 = 𝑖𝑗

𝑥𝑖𝑗 (or number of matches in the week)

Page 12: Speed limits accidents and assignment

Equity issues

}

𝐺1 and 𝐺2 act as secondary criteria, after no. matches

𝑚𝑖 = 𝑗 𝑥𝑖𝑗 = number of matches played by man 𝑖

Solution 1: 𝑚𝐴 = 1 and 𝑚𝐵 = 1

Solution 2: 𝑚𝐴 = 2 and 𝑚𝐵 = 0

𝑦𝑖(𝑘)

= 1 if man 𝑖 gets at least 𝑘 matches in the week

𝐺𝑘 = 𝑖 𝑦𝑖(𝑘)

= number getting at least 𝑘 matches

solution 1 fairer

Page 13: Speed limits accidents and assignment

If – then constraints

If 𝑚𝑖 ≥ 𝑘 then 𝑦𝑖𝑘

= 1 non − linear but imposed by

𝑘𝑦𝑖(𝑘)

≤ 𝑚𝑖 ≤ 𝑘 − 𝜀 1 − 𝑦𝑖(𝑘)

+ 5𝑦𝑖(𝑘)

Maximise 𝑧 = 𝑖𝑗 𝑥𝑖𝑗 + 𝛼1𝐺1 + 𝛼2𝐺2

𝛼1 = 0.01 and 𝛼2 = 0.0001

𝐺1 = 16 𝐺2 = 8

Page 14: Speed limits accidents and assignment

Solution: assigned groups

Day Players

Monday Peter W, Colin C, Keith B, Brian F

Tuesday Tom B, Peter W, Mike M, John S, Phil M, Brian F, Peter K, Ken L

Wednesday Barry T, Keith I, Keith B, Michael L

Thursday Barry T, Tom B, Colin C, Mike M, Alan C, George StC, Peter K, Willie McM

Copy and paste into email message to group members

Page 15: Speed limits accidents and assignment

Two devices in the optimisation

• Integer linear programing problem

– mix of binary and integer variables

• “If-then” conditions: if 𝑚𝑖 ≥ 𝑘 then 𝑦𝑖𝑘

= 1

– intrinsically non-linear

– but implemented via linear constraints

• Hierarchy of criteria: 𝑖𝑗 𝑥𝑖𝑗 , 𝐺1, 𝐺2

– but combined into one objective function

– 𝑧 = 𝑖𝑗 𝑥𝑖𝑗 + 𝛼1𝐺1 + 𝛼2𝐺2

Page 16: Speed limits accidents and assignment

Summary

• Efficient and fair

– algorithm makes life much easier for me

– no favouritism: random permutation of names

• Article in Mathematics Today

– or at http://discovery.ucl.ac.uki/1522020

• Algorithm now produced as a Shiny App

– https://mikemaher.shinyapps.io/TennisApp

• So no need for R or knowledge of the algorithm

– just need to upload the availability matrix