Too complicated of a non linear model for brms?


#1

As I try to win more actuaries over to the Bayesian world, I’m trying to get a model actuaries would be familiar with into a Bayesian framework and would really like to do it using brms.

Most of the models in this paper are pretty easy to code up. The fifth model, a Chain Ladder model, on page 18 of the pdf (page number 140) is the trickiest.

All the models in this paper look at a group of insured accidents in a given year (accident year / AY) and fit how much is paid for those accidents as that group ages.

The data provided in the paper:

AY Age1 Age2 Age3 Age4 Age5 Age6 Age7 Age8 Age9 Age10
2001 670 1,480 1,939 2,466 2,838 3,004 3,055 3,133 3,141 3,160
2002 768 1,593 2,464 3,020 3,375 3,554 3,602 3,627 3,646 -
2003 741 1,616 2,346 2,911 3,202 3,418 3,507 3,529 - -
2004 862 1,755 2,535 3,271 3,740 4,003 4,125 - - -
2005 841 1,859 2,805 3,445 3,950 4,186 - - - -
2006 848 2,053 3,076 3,861 4,352 - - - - -
2007 902 1,928 3,004 3,881 - - - - - -
2008 935 2,104 3,182 - - - - - - -
2009 759 1,585 - - - - - - - -
2010 723 - - - - - - - - -

If you increment the data and then divide by the total paid so far, you get the following:

AY Age1 Age2 Age3 Age4 Age5 Age6 Age7 Age8 Age9 Age10
2001 0.2120 0.2563 0.1453 0.1668 0.1177 0.0525 0.0161 0.0247 0.0025 0.0060
2002 0.2106 0.2263 0.2389 0.1525 0.0974 0.0491 0.0132 0.0069 0.0052 -
2003 0.2100 0.2479 0.2069 0.1601 0.0825 0.0612 0.0252 0.0062 - -
2004 0.2090 0.2165 0.1891 0.1784 0.1137 0.0638 0.0296 - - -
2005 0.2009 0.2432 0.2260 0.1529 0.1206 0.0564 - - - -
2006 0.1949 0.2769 0.2351 0.1804 0.1128 - - - - -
2007 0.2324 0.2644 0.2772 0.2260 - - - - - -
2008 0.2938 0.3674 0.3388 - - - - - - -
2009 0.4789 0.5211 - - - - - - - -
2010 1.0000 - - - - - - - - -

The Chain Ladder model, at its heart, is trying to get at a pattern of incremental percentages which add up to 100%. The advantage of incrementing and dividing the data first is I can remove P_i from the formula in the paper.

To me that sounds like a good use for the Dirichlet distribution, though I am a novice when it comes to using it. The model I’ve got in my head:

y_{AY,Age} \thicksim N(\mu_{AY,Age}, \sigma)
\mu_{AY,Age} = \frac {Pattern[DevAge]} {\sum Pattern[1:{MaxDevAge_{AY}}]}
Pattern \thicksim Dirichlet(\alpha)

The MaxDevAge being how old each AY is.

My question: is there a way to code this up in brms? I get the feeling brms not designed for something like this, so I thought I’d ask before spinning my wheels on a hopeless task.


#2

I didn’t take a closer look at the reference you provided, but given your evaluation is correct and you need a dirichlet parameter in your non-linear equation, then I suggest using Stan directly.


#3

brms has been such a huge help in using Stan, I always try to use it if I can. Thanks for the quick reply.