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? ​

​To answer this we need to go to the relevant section of the SciPy documentation [3]: 
Picture
It’s not obvious from this, but we can show that the Lomax from Scipy, with loc = 0, c = the tail parameter (alpha from wikipeda), and scale = the shape parameter (lamda from Wikipedia), is actually equal to the Lomax distribution in the standard specification.

To see this, first note that $lomax.pdf(x,c,l,s) = \frac{ lomax(y,c)} {scale}$, where $y = \frac{x-l}{s}$, using the definition of $lomax(x,c)$, setting $loc = 0$, this is equal to :
​
$$\frac{\frac{c}{(1+\frac{x}{s})^{c+1}}}{s} = \frac{c * s^{-1}}{(1+\frac{x}{s})^{c+1}} = \frac{c * s^{-1}}{(\frac{x+s}{s})^{c+1}} = \frac{c * s^{-1} s^{c+1}}{(x+s)^{c+1}} = \frac{c * s^{c}}{(x+s)^{c+1}}$$

Which get’s us the desired result. i.e. by just using $loc = 0$, and setting $c = \alpha$, and $scale = \lambda$, the SciPy lomax becomes the regular Lomax.
 
 [1] https://en.wikipedia.org/wiki/Lomax_distribution
[2] IFoA - Core Reading for the 2022 Exams - CS2 Risk Modelling and Survival Analysis
[3] https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.lomax.html

Your comment will be posted after it is approved.


Leave a Reply.

    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