# Bühlmann model

In credibility theory, a branch of study in actuarial science, the Bühlmann model is a random effects model (or "variance components model" or hierarchical linear model) used to determine the appropriate premium for a group of insurance contracts. The model is named after Hans Bühlmann who first published a description in 1967.

## Model description

Consider i risks which generate random losses for which historical data of m recent claims are available (indexed by j). A premium for the ith risk is to be determined based on the expected value of claims. A linear estimator which minimizes the mean square error is sought. Write
* X$_{ij}$ for the j-th claim on the i-th risk (we assume that all claims for i-th risk are independent and identically distributed)
* ${\bar {X}}_{i}={\frac {1}{m}}\sum _{j=1}^{m}X_{ij}$ for the average value.
* $\Theta _{i}$ - the parameter for the distribution of the i-th risk
* $m(\vartheta )=\operatorname {E} \left[X_{ij}|\Theta _{i}=\vartheta \right]$
* $\Pi =\operatorname {E} (m(\vartheta )|X_{i1},X_{i2},...X_{im})$ - premium for the i-th risk
* $\mu =\operatorname {E} (m(\vartheta ))$
* $s^{2}(\vartheta )=\operatorname {Var} \left[X_{ij}|\Theta _{i}=\vartheta \right]$
* $\sigma ^{2}=\operatorname {E} \left[s^{2}(\vartheta )\right]$
* $v^{2}=\operatorname {Var} \left[m(\vartheta )\right]$
Note: $m(\vartheta )$ and $s^{2}(\vartheta )$ are functions of random parameter $\vartheta$
The Bühlmann model is the solution for the problem:
    ${\underset {a_{i0},a_{i1},...,a_{im}}{\operatorname {arg\,min} }}\operatorname {E} \left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-\Pi \right)^{2}\right]$
where $a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}$ is the estimator of premium $\Pi$ and arg min represents the parameter values which minimize the expression.

## Model solution

The solution for the problem is:
    $Z{\bar {X}}_{i}+(1-Z)\mu$
where:
    $Z={\frac {1}{1+{\frac {\sigma ^{2}}{v^{2}m}}}}$
We can give this result the interpretation, that Z part of the premium is based on the information that we have about the specific risk, and (1-Z) part is based on the information that we have about the whole population.

### Proof

The following proof is slightly different from the one in the original paper. It is also more general, because it considers all linear estimators, while original proof considers only estimators based on average claim.
    Lemma. The problem can be stated alternatively as:
       $f=\mathbb {E} \left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-m(\vartheta )\right)^{2}\right]\to \min$
Proof:
    ${\begin{aligned}\mathbb {E} \left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-m(\vartheta )\right)^{2}\right]&=\mathbb {E} \left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-\Pi \right)^{2}\right]+\mathbb {E} \left[\left(m(\vartheta )-\Pi \right)^{2}\right]-2\mathbb {E} \left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-\Pi \right)\left(m(\vartheta )-\Pi \right)\right]\\&=\mathbb {E} \left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-\Pi \right)^{2}\right]+\mathbb {E} \left[\left(m(\vartheta )-\Pi \right)^{2}\right]\end{aligned}}$
The last equation follows from the fact that
    ${\begin{aligned}\mathbb {E} \left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-\Pi \right)\left(m(\vartheta )-\Pi \right)\right]&=\mathbb {E} _{\Theta }\left[\mathbb {E} _{X}\left.\left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-\Pi \right)(m(\vartheta )-\Pi )\right|X_{i1},\ldots ,X_{im}\right]\right]\\&=\mathbb {E} _{\Theta }\left[\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-\Pi \right)\left[\mathbb {E} _{X}\left[(m(\vartheta )-\Pi )|X_{i1},\ldots ,X_{im}\right]\right]\right]\\&=0\end{aligned}}$
We are using here the law of total expectation and the fact, that $\Pi =\mathbb {E} [m(\vartheta )|X_{i1},\ldots ,X_{im}].$
In our previous equation, we decompose minimized function in the sum of two expressions. The second expression does not depend on parameters used in minimization. Therefore, minimizing the function is the same as minimizing the first part of the sum.
Let us find critical points of the function
    ${\frac {1}{2}}{\frac {\partial f}{\partial a_{i0}}}=\mathbb {E} \left[a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-m(\vartheta )\right]=a_{i0}+\sum _{j=1}^{m}a_{ij}\mathbb {E} (X_{ij})-\mathbb {E} (m(\vartheta ))=a_{i0}+\left(\sum _{j=1}^{m}a_{ij}-1\right)\mu$
    $a_{i0}=\left(1-\sum _{j=1}^{m}a_{ij}\right)\mu$
For $k\neq 0$ we have:
    ${\frac {1}{2}}{\frac {\partial f}{\partial a_{ik}}}=\mathbb {E} \left[X_{ik}\left(a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}-m(\vartheta )\right)\right]=\mathbb {E} \left[X_{ik}\right]a_{i0}+\sum _{j=1,j\neq k}^{m}a_{ij}\mathbb {E} [X_{ik}X_{ij}]+a_{ik}\mathbb {E} [X_{ik}^{2}]-\mathbb {E} [X_{ik}m(\vartheta )]=0$
We can simplify derivative, noting that:
    ${\begin{aligned}\mathbb {E} [X_{ij}X_{ik}]&=\mathbb {E} \left[\mathbb {E} [X_{ij}X_{ik}|\vartheta ]\right]=\mathbb {E} [{\text{cov}}(X_{ij}X_{ik}|\vartheta )+\mathbb {E} (X_{ij}|\vartheta )\mathbb {E} (X_{ik}|\vartheta )]=\mathbb {E} [(m(\vartheta ))^{2}]=v^{2}+\mu ^{2}\\\mathbb {E} [X_{ik}^{2}]&=\mathbb {E} \left[\mathbb {E} [X_{ik}^{2}|\vartheta ]\right]=\mathbb {E} [s^{2}(\vartheta )+(m(\vartheta ))^{2}]=\sigma ^{2}+v^{2}+\mu ^{2}\\\mathbb {E} [X_{ik}m(\vartheta )]&=\mathbb {E} [\mathbb {E} [X_{ik}m(\vartheta )|\Theta _{i}]=\mathbb {E} [(m(\vartheta ))^{2}]=v^{2}+\mu ^{2}\end{aligned}}$
Taking above equations and inserting into derivative, we have:
    ${\frac {1}{2}}{\frac {\partial f}{\partial a_{ik}}}=\left(1-\sum _{j=1}^{m}a_{ij}\right)\mu ^{2}+\sum _{j=1,j\neq k}^{m}a_{ij}(v^{2}+\mu ^{2})+a_{ik}(\sigma ^{2}+v^{2}+\mu ^{2})-(v^{2}+\mu ^{2})=a_{ik}\sigma ^{2}-\left(1-\sum _{j=1}^{m}a_{ij}\right)v^{2}=0$
    $\sigma ^{2}a_{ik}=v^{2}\left(1-\sum _{j=1}^{m}a_{ij}\right)$
Right side doesn't depend on k. Therefore, all $a_{ik}$ are constant
    $a_{i1}=\cdots =a_{im}={\frac {v^{2}}{\sigma ^{2}+mv^{2}}}$
From the solution for $a_{i0}$ we have
    $a_{i0}=(1-ma_{ik})\mu =\left(1-{\frac {mv^{2}}{\sigma ^{2}+mv^{2}}}\right)\mu$
Finally, the best estimator is
    $a_{i0}+\sum _{j=1}^{m}a_{ij}X_{ij}={\frac {mv^{2}}{\sigma ^{2}+mv^{2}}}{\bar {X_{i}}}+\left(1-{\frac {mv^{2}}{\sigma ^{2}+mv^{2}}}\right)\mu =Z{\bar {X_{i}}}+(1-Z)\mu$