','..','$myPermit') ?>
SYLLABUS Previous: 4.5.1 Forecast possible realizations
Up: 4.5 Methods for European
Next: 4.6 Computer quiz
} else if(Math.abs(kappa-1.)<0.001){ //Separable log-normal
if (markers){
for (k=0; k<numberOfRealisations; k++){
f[j]+= option.getValue(currentState[k][0] *x[j]/strike) *mark[k][0];
g[j]+= option.getValue(currentState[k][0] *x[j]/strike);
}
} else
for (k=0; k<numberOfRealisations; k++)
f[j]+= option.getValue(currentState[k][0] *x[j]/strike);
}
f[j]=Math.exp(-time*rate)*f[j]/numberOfRealisations;
g[j]=Math.exp(-time*rate)*g[j]/numberOfRealisations;
If the problem is separable, the random walk is first scaled according to
(4.5.1#eq.2) to obtain the terminal value of the underlying currentState[k][0]*x[j]/strike; this is then used as an argument
to accumulate the terminal payoff
f[j]+=option.getValue() and finally calculate
the discounted average of (4.5.2#eq.3) using the last two lines.
Note that two functions (f[j],g[j]) have been used to compare the
price obtained with-/out barriers.
The VMARKET applet below illustrates the
result in the case of a simple vanilla put option.
SYLLABUS Previous: 4.5.1 Forecast possible realizations Up: 4.5 Methods for European Next: 4.6 Computer quiz