Tiempo de impago

% Time to default of IBM Bond
% Montecarlo simulation of Time
% Time follows an exponential distribution with Intensity lambda=1/Average T
% We double check the simulation with the Cumulative Distribution Function F

lambda=0.01
iterations=1000000
average=1/lambda

lbound=5
ubound=50

serie = exprnd(average,iterations,1);

%over_ubound=(serie>ubound);
%below_lbound=(serie

sides= (serie>lbound) & (serie

%results=sum(over_ubound)
%results=sum(below_lbound)

results=sum(sides)

proba=results/iterations

%check
check=expcdf(ubound,average)-expcdf(lbound,average)

Septiembre 2010
L M X J V S D
« Jul    
 12345
6789101112
13141516171819
20212223242526
27282930