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

The Lomax pareto distribution in SciPy

17/3/2023

 

​The Python library SciPy, contains a version of the Lomax distribution which it defines as:
$$f(x,c) = \frac{c}{(a+x)^{(c+1)}}$$
Whereas, the ‘standard’ specification is [1]:
$$f(x,c, \lambda) = \frac{c \lambda ^ c}{(a+x)^{(c+1)}}$$
Which is also the definition in the IFoA core reading [2]:
Picture
​​So, how can we use the SciPy version of the Lomax to simulate the standard version, given we are missing the $ \lambda ^c​$ term? ​

Read More

MLE of a Uniform Distribution

28/2/2023

 

I noticed something surprising about the Maximum Likelihood Estimator (MLE) for a uniform distribution yesterday.

Suppose we’re given sample $X’ = {x_1, x_2, … x_n}$ from a uniform distribution $X$ with parameters $a,b$. Then the MLE estimator for $a = min(X’)$, and $b = max(X’)$. [1] All straight forward so far.

However, examining the estimators, we can also say with probability = 1 that $a < min(X’)$, and similarly that $b > max(X’)$. Isn't it strange that the MLE estimators are clearly less/more than the true values? 

So what can we do instead?
Picture
(Since Gauss did a lot of the early work on MLE, here's a portrait of him as a young man. )
Source: https://commons.wikimedia.org/wiki/File:Bendixen_-_Carl_Friedrich_Gau%C3%9F,_1828.jpg

Read More

What is a 'Net' Quota Share?

7/10/2022

 

I recently received an email from a reader asking a couple of questions :

"I'm trying to understand Net vs Gross Quota shares in reinsurance. Is a 'Net Quota Share' always defining a treaty where the reinsurer will pay ceding commissions on the Net Written Premium? ... Are there some Net Quota Shares where the reinsurer caps certain risks (e.g. catastrophe)?"

It's a reasonable question, and the answer is a little context dependent, full explanation given below.


Picture
Source: https://unsplash.com/@laurachouette, London

(As an aside, in the last couple of weeks, the UK has lurched from what was a rather pleasant summer into a fairly chilly autumn, to mirror this, here's a photo of London looking a little on the grey side.)


Read More

Backtesting inflation modelling - median of top x losses

29/7/2022

 


I wrote a quick script to backtest one particular method of deriving claims inflation from loss data. I first came across the method in 'Pricing in General Insurance' by Pietro Parodi [1], but I'm not sure if the method pre-dates the book or not.

In order to run the method all we require is a large loss bordereaux, which is useful from a data perspective. Unlike many methods which focus on fitting a curve through attritional loss ratios, or looking at ultimate attritional losses per unit of exposure over time, this method can easily produce a *large loss* inflation pick. Which is important as the two can often be materially different.
Picture
Source: Willis Building and Lloyd's building, @Colin, https://commons.wikimedia.org/wiki/User:Colin

Read More

An Actuary learns Machine Learning - Part 13 - Kaggle Tabular Playground Competition - June 22

1/7/2022

 

Picture



In which we recreate the previous analysis, but in Python this time. And then add a new submission using Mean rather than median to impute missing values.





Source: https://somewan.design


Read More

An Actuary learns Machine Learning - Part 12 - Kaggle Tabular Playground Competition - June 22

24/6/2022

 

Picture

​

​In which we start a new Kaggle competition, submit a dummy attempt, and then build a very basic Excel model to establish a baseline for future progress.
​




​Source: https://somewan.design


Read More

Converting from a Gross to Net Quota Share

10/6/2022

 

Quota Share contracts generally deal with acquisition costs in one of two ways - premium is either ceded to the reinsurer on a ‘gross of acquisition cost’ basis and the reinsurer then pays a large ceding commission to cover acquisition costs and expenses, or premium is ceded on a ‘net of acquisition’ costs basis, in which case the reinsurer pays a smaller commission to the insurer, referred to as an overriding commission or ‘overrider’, which is intended to just cover internal expenses.

Another way of saying this is that premium is either ceded based on gross gross written premium, or gross net written premium.

I’ve been asked a few times over the years how to convert from a gross commission basis to the equivalent net commission basis, and vice versa. I've written up an explanation with the accompanying formulas  below.

Picture
Source: @ Kuhnmi, Zurich

Read More

Definition of Tangible Book Value per Share

19/5/2022

 

Investopedia defines TBVPS to be:

"Tangible book value per share (TBVPS) is the value of a company’s tangible assets divided by its current outstanding shares." [1]

I'm pretty sure this is incorrect. or at best misleading!

Picture
Canary Wharf, source: https://commons.wikimedia.org/wiki/User:King_of_Hearts

Read More

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

Notes on the Excel Forecast.ETS function

1/4/2022

 


The official Microsoft documentation for the Excel Forecast.ETS function is pretty weak [1]. Below I’ve written a few notes on how the function works, and the underlying formulas.
Picture
Source: Microsoft office in Seattle, @Coolcaesar, https://en.wikipedia.org/wiki/File:Building92microsoft.jpg

Read More

Tallying the estimates of Insured Market Loss from the Ukraine Conflict

25/3/2022

 


It's still very early days to understand the true fallout from Russia's invasion of Ukraine, but I thought it would be interesting to tally a few of the estimates for the insured loss we've seen so far, all of the below come from the Insider. 

Please note, I'm not endorsing any of these estimates, merely collating them for the interested reader! 
Picture
Kiv Perchersk Lavra Monastery, Kyiv. @Andriy155

Read More

Aggregating probability forecasts

18/3/2022

 

There's some interesting literature from the world of forecasting and natural sciences on the best way to aggregate predictions from multiple models/sources.

For a well-written, moderately technical introduction, see the following by Jaime Sevilla:
forum.effectivealtruism.org/posts/sMjcjnnpoAQCcedL2/when-pooling-forecasts-use-the-geometric-mean-of-odds

Jaime’s article suggests a geometric mean of odds as the preferred method of aggregating predictions. I would argue however that when it comes to actuarial pricing, I'm more of a fan of the arithmetic mean, I'll explain why below.
Picture

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

<<Previous

    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