THE REINSURANCE ACTUARY
  • Blog
  • Project Euler
  • Category Theory
  • Disclaimer

Downloading data from Wiki

22/4/2022

 


Did you know about this cool tool, which allows you to download data from a Wikipedia table as a csv:

wikitable2csv.ggor.de/
Picture

How to interpolate in a Spreadsheet

15/4/2022

 

Here's a useful trick that you might not have seen before. Suppose we have some data with  includes rows with values missing, then we can use the below formula to apply linear interpolate to fill in the missing datapoints, without having to laboriously type in the interpolation formula long hand (which I used to do all the time)

Picture

Read More

Python script - scrape CME FedWatch predictions

8/4/2022

 

I wrote a python script which uses Selenium to scrape the predictions for Fed rate movements from the CME FedWatch tool.

www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html#resources

The tool works by converting the price of a 30 day Fed Fund future into an implied probability of a given range of yields.

The CME website embeds the output in a something called an 'iframe', which I had never heard of before, and the iframe then contains a dashboard powered by something called Quikstrike. It took me a while to figure out how to switch focus to the iframe, as you can't simply reference elements inside the iframe without first switching focus.

The script below may not look too complicated, but believe me, it took a while to write.

Picture
Old Federal Reserve building Philadelphia, Source: https://commons.wikimedia.org/wiki/User:Beyond_My_Ken

Read More

Python script - PredictIt API

11/3/2022

 

I wrote a quick Python script to download the latest odds from PredictIt, and then output to an Excel file. I've pasted it below as an extract from a Jupyter notebook:

PredictIt is an online prediction website, mainly focused on Political events:
www.predictit.org/

I think it's great that PredictIt allow access like this, before I realised the API exists I was using Selenium to scrape the info through Chrome, which was much slower to run, and also occasionally buggy.


Read More

How Coronavirus misinformation propogates even with the best of intentions.

20/3/2020

 

This post is about two pieces of writing released this week, and how easy it is for even smart people to be wrong.

The story starts with an open letter written to the UK Government signed by 200+ scientists, condemning the government’s response to the Coronavirus epidemic; that the response was not forceful enough, and that the government was risking lives by their current course of action. The letter was widely reported and even made it to the BBC frontpage, pretty compelling stuff.

Link [1]

The issue is that as soon as you start scratching beneath the surface, all is not quite what it seems. Of the 200+ scientists, about 1/3 are PhD students, not an issue in and of itself, but picking out some of the subjects we’ve got:
  • PhD Student in Complex Systems – okay, quite relevant, let’s keep going down the list
  • PhD Student in Combinatorics – hmm, now we are listening to pure mathematicians? I really enjoyed studying combinatorics at uni, but I'm not sure it gives a student any particular expertise in epidimiology
  • PhD Student in Theoretical Particle Physics – other than being numerically literate this is about as far from relevant as you can get!

Read More

Self-Driving Cars - How close are we to wide spread adoption?

26/4/2017

 


Driverless, Autonomous, Self-driving, robotic, drone cars, whatever you want to call them, I think self-driving cars are going to be awesome..

The potential benefits include:
  • Vastly improved road safety
  • Increased access for the young, the elderly, or people with disabilities
  • Increased fuel efficiency
  • An end to drink driving
  • Reduction in road congestion once cars have the ability to coordinate their route planning and driving
  • Improved comfort for the driver and passengers
  • Reduction in the need for parking spaces
  • Increased viability for sharing based business models

But how far away are we from this being a reality? It seems like we are constantly being told that self-driving cars are just on the horizon, and that wide spread use of self-driving cars will arrive sooner than we think. It got me thinking though, surely even when manufacturers start churning out driverless cars, isn't it still going to take a considerable amount of time before they begin to replace all the cars currently being driven? Most people will not suddenly go out and replace their current car the moment self-driving cars are available on the market.
​

Picture


​Replacing all the old cars

Almost all cars that are currently being driven today will never be self-driving, it will only be new cars, after a certain point, that will start to be self-driving. So even if all new cars from now on were to be self driving, there would still be a delay as old driven cars were slowly replaced by self driving cars.

I thought I'd try to do some modelling to see how quickly would this process might take place.


As a starting point, let's assume that we will start to see self-driving cars being produced by 2019.

I found the following report from the Department of Transport which details the number of cars on the road today, and the number of new cars registered every year. 

www.gov.uk/government/uploads/system/uploads/attachment_data/file/608374/vehicle-licensing-statistics-2016.pdf

The important statistics are:

There are currently $37.3$m cars on the road
Each year the number of registered cars increases by approximately $600,000$
Around $3.3$m new cars are registered every year.

I then extrapolated these statistics based on three different scenarios:
​
Scenario 1 - All new cars from 2019 onward are driverless
Picture

We can see that even under this very optimistic scenario, it's not until 2025 that we will see a majority of cars on the road being driverless. 

It's probably not reasonable though to assume that all new cars produced after 2019 will be driverless, so let's look at the effect of slowing increasing the proportion of new cars that are driverless.

Scenario 2 - Assuming linear increase in % of new cars produced which are Driverless between 2019 and 2030​
​

In this scenario we assume that in 2018 all new cars are driven, and that by 2030 all new cars are driverless, and we assume a linear increase in the % of new cars which are driverless between these two years.

Picture

We see that under this scenario, it's not until 2030 that we start to see a majority of driverless cars on the road.

To get an alternative view, let's look at a quicker rate of adoption, let's suppose instead that by 2025, all new cars will be driverless.
​
Picture
Now we see that a majority of cars are driverless ​by around 2027, with a strong majority emerging by 2030.

Picture


Conclusion

Even when we assume that driverless cars will start to be produced by 2019, based on current trends of car replacement, and depending on the speed at which self driving cars are produced, we shouldn't expect a majority of cars on the road to be driverless until at least the late 20s or maybe even early 30s. So when analysts say that driverless cars will be common much sooner than people expect, they need to be careful about how they define common.

    Author

    ​​I work as an actuary and underwriter at a global reinsurer in London.

    I mainly write about Maths, Finance, and Technology.
    ​
    If you would like to get in touch, then feel free to send me an email at:

    ​LewisWalshActuary@gmail.com

      Sign up to get updates when new posts are added​

    Subscribe

    RSS Feed

    Categories

    All
    Actuarial Careers/Exams
    Actuarial Modelling
    Bitcoin/Blockchain
    Book Reviews
    Economics
    Finance
    Forecasting
    Insurance
    Law
    Machine Learning
    Maths
    Misc
    Physics/Chemistry
    Poker
    Puzzles/Problems
    Statistics
    VBA

    Archives

    March 2023
    February 2023
    October 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    October 2021
    September 2021
    August 2021
    July 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    May 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    April 2019
    March 2019
    August 2018
    July 2018
    June 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    June 2017
    May 2017
    April 2017
    March 2017
    February 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    April 2016
    January 2016

  • Blog
  • Project Euler
  • Category Theory
  • Disclaimer