예제 #1
0
 /// <summary>
 /// Initialize a new MonteCarloModel optionally using control variate techniques.
 /// </summary>
 /// <remarks>
 /// In order to use the control variate technique, the user should provide the
 /// additional control option, namely the <paramref name="cvPathPricer"/> and
 /// the <paramref name="cvOptionValue"/>.
 /// </remarks>
 /// <param name="pathGenerator">
 /// The <see cref="PathGenerator"/> generating single or multiple random walks.
 /// </param>
 /// <param name="pathPricer">
 /// The <see cref="PathPricer"/> calculating the option price on each sample.
 /// </param>
 /// <param name="sampleAccumulator">
 /// A sample accumulator to record statistics.
 /// </param>
 /// <param name="cvPathPricer">
 /// The control variate <see cref="PathPricer"/> or
 /// null (<b>Nothing</b> in Visual Basic).
 /// </param>
 /// <param name="cvOptionValue">
 /// The option value in case of using a <paramref name="cvPathPricer"/>.
 /// </param>
 public MonteCarloModel(PathGenerator pathGenerator,
                        PathPricer pathPricer, RiskStatistics sampleAccumulator,
                        PathPricer cvPathPricer, double cvOptionValue)
 {
     _pathGenerator    = pathGenerator;
     _pathPricer       = pathPricer;
     SampleAccumulator = sampleAccumulator;
     _cvPathPricer     = cvPathPricer;
     _cvOptionValue    = cvOptionValue;
 }
예제 #2
0
 /// <summary>
 /// Initialize a new MonteCarloModel without using control variate techniques.
 /// </summary>
 /// <param name="pathGenerator">The <see cref="PathGenerator"/> generating single or multiple random walks.</param>
 /// <param name="pathPricer">The <see cref="PathPricer"/> calculating the option price on each sample.</param>
 /// <param name="sampleAccumulator">A sample accumulator to record statistics.</param>
 public MonteCarloModel(PathGenerator pathGenerator,
                        PathPricer pathPricer, RiskStatistics sampleAccumulator)
     : this(pathGenerator, pathPricer, sampleAccumulator, null, 0.0)
 {
 }
예제 #3
0
 /// <overloads>
 /// Initialize a new MonteCarloModel.
 /// </overloads>
 /// <summary>
 /// Initialize a new MonteCarloModel without using control variate techniques
 /// and using the default <see cref="RiskStatistics"/> accumulator.
 /// </summary>
 /// <param name="pathGenerator">The <see cref="PathGenerator"/> generating single or multiple random walks.</param>
 /// <param name="pathPricer">The <see cref="PathPricer"/> calculating the option price on each sample.</param>
 public MonteCarloModel(PathGenerator pathGenerator,
                        PathPricer pathPricer)
     : this(pathGenerator, pathPricer, new RiskStatistics())
 {
 }