<< QuantLib`
<< Statistics`

?SVJDModel

\(\(mlst = {mbas = 
            SVJDModel[40, 0.08, 0.06, 0.15, 0.15, 0.15, 4, 0, 0, 0, 0], 

          mVt = SVJDModel[40, 0.08, 0.06, 0.2, 0.15, 0.15, 4, 0, 0, 0, 0], 

          msigmav = 
            SVJDModel[40, 0.08, 0.06, 0.15, 0.3, 0.15, 4, 0, 0, 0, 0], 

          mrho = SVJDModel[40, 0.08, 0.06, 0.15, 0.15, 0.15, 4, 0.1, 0, 0, 
              0], 
mjump = 
            SVJDModel[40, 0.08, 0.06, Sqrt[0.0125], 0.2, Sqrt[0.0125], 4, 0, 
              2, 0, 0.07]};\)\)

ilst = 
      Table[EuropeanOption[K, 0.25, PutOption], {K, 38, 42}]

(analtbl = Outer[Value[#2, #1] &, mlst, ilst]) // 
      TableForm

kf[s_, anti_] := 
      Keyfigures[i, m, Method -> MonteCarlo, 
        AntitheticPaths -> anti, ControlVariate -> False, 
        Samples -> s]

blok[s_, anti_, 
        resim_:  100] := (
lst = 
          Table[{Value, StandardError} /. 
              kf[s, anti], {resim}]; 
{anal, 
          lst[[1, 1]], lst[[1, 2]], Mean[lst[[All, 1]]] - anal, 
          StandardDeviation[
            lst[[All, 1]] - anal]}
)

comb = Flatten[Outer[{#2, #1} &, mlst, ilst], 1];

oneblok[no_] := (anal = Flatten[analtbl][[no]]; 
        i = comb[[no, 1]]; m = comb[[no, 2]]; 
        blok[10000, True, 100])

oneblok[16]

oneblok[20]

start = SessionTime[]

oneblok[1]

oneblok[2]

oneblok[3]

oneblok[4]

oneblok[5]

oneblok[6]

oneblok[7]

oneblok[8]

oneblok[9]

oneblok[10]

oneblok[11]

oneblok[12]

oneblok[13]

oneblok[14]

oneblok[15]

oneblok[16]

oneblok[17]

oneblok[18]

oneblok[19]

oneblok[20]

oneblok[21]

oneblok[22]

oneblok[23]

oneblok[24]

oneblok[25]

slut = SessionTime[]; slut - start

%/60/60

exp = Table[ExportTeXString[List /@ Out[i]], {i, 12, 36}]

stmp = OpenWrite["c:\\cand\\MCSVJD-analSVJD-Bates.txt"]; 
    WriteString[stmp, exp]; Close[stmp]