Enjoy.
- claims = {1000, 1500, 4000, 10000, 15000, 40000};
- counts = {8, 3, 2, 5, 2, 1};
- lr = {0.2,
- 0.8};(*loss ratio at min/max*)
- sp = 10000;(*standard premium*)
- If[Length[claim] != Length[counts],
- Print["Input claims/counts incorrect!"]];
- expA = (claims.counts)/Total[counts]*1.;
- AH = Part[lr, 1]*sp;
- AG = Part[lr, 2]*sp;
- t1 = Table[
- Max[0, (Part[claims, i] - AG)*Part[counts, i]/Total[counts]], {i,
- 1, Length[claims]}];
- t2 = Table[
- Max[0, (AH - Part[claims, i])*Part[counts, i]/Total[counts]], {i,
- 1, Length[claims]}];
- \[Phi] = Total[t1]/expA;(*ins charge*)
- \[Psi] =
- Total[t2]/expA;(*ins savings*)
- nic = Total[t1] - Total[t2];
- Print[{\[Phi], \[Psi], nic}]
- {0.398577,0.0676157,2214.29}