Ruben
This must be due to the data you are using. I can see that Mathematica generates negative values along the code execution, which leads to the inconsistent valuation.
Try again with my values:
zrates = {0.012, 0.015, 0.0167, 0.0176, 0.019, 0.0201, 0.0223, 0.0235};
times = {0.25, 0.5, 1, 1.5, 2, 3, 4, 5};
zrobj = TemporalData[zrates, {times}];
intrate = Interpolation[zrobj["Path"], Method -> "Spline"];
DF[x_] := Exp[-intrate[x]*x];
{dt, y, R} = {0.005, 5, 0.4};
simproc =
RandomFunction[
combprc /. {\[Mu] -> 0.022, \[Sigma]1 -> 0.2, \[Theta] ->
0.005, \[Beta] -> 0.015, \[Sigma]2 -> 0.05, \[Rho] -> 0.5,
s0 -> 0.025, c0 -> 0.0125}, {0, y, dt}, 1000,
Method -> "StochasticRungeKutta"] ;
Exposure[T_, S_, t_, v_] := (T - t)*Max[v - S, 0];
expswap = TimeSeriesMapThread[Exposure[5, 0.025, #1, #2] &, swapproc];
eeswap = TimeSeriesThread[Mean, expswap,
ResamplingMethod -> Interpolation];
eehaz = TimeSeriesThread[Mean, hazrate,
ResamplingMethod -> Interpolation];
epe[x_] :=
Mean[TimeSeriesWindow[eeswap, {0, Max[dt, x]},
ResamplingMethod -> Interpolation]];
exphazrate[x_] :=
Mean[TimeSeriesWindow[eehaz, {0, Max[dt, x]},
ResamplingMethod -> Interpolation]];
survfunc[x_] := Exp[-exphazrate[x]*x];
CVAS[n_, fr_, r_] :=
Module[{f, g, s},
f = TemporalData[Table[{i, survfunc[i]}, {i, 0, n, fr}]];
g = MovingMap[First[#] - Last[#] &, f, {2}];
s = (1 - r)*Sum[DF[i]*epe[i]*g["PathFunction"][i], {i, fr, n, fr}];
s];
As you can see, I get the following result with my values:
CVAS[5, 1/2, 0.4]*10^4
4.74152