umontreal.iro.lecuyer.examples.AsianQMC Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ssj Show documentation
Show all versions of ssj Show documentation
SSJ is a Java library for stochastic simulation, developed under the direction of Pierre L'Ecuyer,
in the Département d'Informatique et de Recherche Opérationnelle (DIRO), at the Université de Montréal.
It provides facilities for generating uniform and nonuniform random variates, computing different
measures related to probability distributions, performing goodness-of-fit tests, applying quasi-Monte
Carlo methods, collecting (elementary) statistics, and programming discrete-event simulations with both
events and processes.
The newest version!
import umontreal.iro.lecuyer.rng.*;
import umontreal.iro.lecuyer.hups.*;
import umontreal.iro.lecuyer.stat.Tally;
import umontreal.iro.lecuyer.util.Chrono;
public class AsianQMC extends Asian {
public AsianQMC (double r, double sigma, double strike,
double s0, int s, double[] zeta) {
super (r, sigma, strike, s0, s, zeta);
}
// Makes m independent randomizations of the digital net p using stream
// noise. For each of them, performs one simulation run for each point
// of p, and adds the average over these points to the collector statQMC.
public void simulateQMC (int m, DigitalNet p,
RandomStream noise, Tally statQMC) {
Tally statValue = new Tally ("stat on value of Asian option");
PointSetIterator stream = p.iterator ();
for (int j=0; j