STFruin08 (MatLab R2007b)

STFruin08 produces the ruin probability in infinite time for mixture of 2 exponentials distribution claims given by Beekman-Bowers approximation. Need "moments.m" function.

Download File

Click the button to demonstrate a graph view. 
Notice: This content requires Java Runtime Environment.
Java Applet and JavaScript should be allowed on your browser.

Fri, May 04 2012 by Dedy Dwi Prastyo

moments.m


clear all;
close all,
clc;
format long;
u=[0;10^9;5*10^9;10^10;2*10^10;5*10^10]; % initial capital of insurance company (in USD)
theta=0.3;                               % relative safety loading
dparameters1=[0.0584 , 3.5900e-10 ; 0.9416 , 7.5088e-09]; % weights (first column) and exponential parameters (second column)
m=moments(1,dparameters1);  % 1st raw moment
m2=moments(2,dparameters1); % 2nd raw moment
m3=moments(3,dparameters1); % 3nd raw moment
delta1=(2*m*theta)/(m2+((4*m*m3/3/m2)-m2)*theta) % scale parameter of gamma distribution function
delta2=(1+theta)/(1+((4*m*m3/3/m2^2)-1)*theta)   % shape parameter of gamma distribution function
psi=(1-gamcdf(u,delta2,1/delta1))/(1+theta)