Пример #1
0
        public AmericanPathPricer(Payoff payoff, int polynomOrder, LsmBasisSystem.PolynomType polynomType)
        {
            scalingValue_ = 1;
            payoff_       = payoff;
            v_            = LsmBasisSystem.pathBasisSystem(polynomOrder, polynomType);

            if (!(polynomType == LsmBasisSystem.PolynomType.Monomial ||
                  polynomType == LsmBasisSystem.PolynomType.Laguerre ||
                  polynomType == LsmBasisSystem.PolynomType.Hermite ||
                  polynomType == LsmBasisSystem.PolynomType.Hyperbolic ||
                  polynomType == LsmBasisSystem.PolynomType.Chebyshev2th))
            {
                throw new Exception("insufficient polynom type");
            }

            // the payoff gives an additional value
            v_.Add(this.payoff);

            StrikedTypePayoff strikePayoff = payoff_ as StrikedTypePayoff;

            if (strikePayoff != null)
            {
                scalingValue_ /= strikePayoff.strike();
            }
        }
 //     int nCalibrationSamples = Null<Size>())
 public MCAmericanEngine(GeneralizedBlackScholesProcess process, int timeSteps, int timeStepsPerYear,
                         bool antitheticVariate, bool controlVariate, int requiredSamples, double requiredTolerance,
                         int maxSamples, ulong seed, int polynomOrder, LsmBasisSystem.PolynomType polynomType,
                         int nCalibrationSamples)
     : base(process, timeSteps, timeStepsPerYear, false, antitheticVariate, controlVariate, requiredSamples,
            requiredTolerance, maxSamples, seed, nCalibrationSamples)
 {
     polynomOrder_ = polynomOrder;
     polynomType_  = polynomType;
 }
 public MCLDAmericanEngine(GeneralizedBlackScholesProcess process, int timeSteps, int timeStepsPerYear, bool antitheticVariate, bool controlVariate, int requiredSamples, double requiredTolerance, int maxSamples, int seed, int polynomOrder, LsmBasisSystem.PolynomType polynomType) : this(NQuantLibcPINVOKE.new_MCLDAmericanEngine__SWIG_3(GeneralizedBlackScholesProcess.getCPtr(process), timeSteps, timeStepsPerYear, antitheticVariate, controlVariate, requiredSamples, requiredTolerance, maxSamples, seed, polynomOrder, (int)polynomType), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public MCPRAmericanBasketEngine(StochasticProcessArray process, int timeSteps, int timeStepsPerYear, bool brownianBridge, bool antitheticVariate, int requiredSamples, double requiredTolerance, int maxSamples, int seed, uint nCalibrationSamples, uint polynomOrder, LsmBasisSystem.PolynomType polynomType) : this(NQuantLibcPINVOKE.new_MCPRAmericanBasketEngine__SWIG_0(StochasticProcessArray.getCPtr(process), timeSteps, timeStepsPerYear, brownianBridge, antitheticVariate, requiredSamples, requiredTolerance, maxSamples, seed, nCalibrationSamples, polynomOrder, (int)polynomType), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #5
0
 public MCAmericanEngine(GeneralizedBlackScholesProcess process, string traits, int timeSteps, int timeStepsPerYear, bool antitheticVariate, bool controlVariate, int requiredSamples, double requiredTolerance, int maxSamples, int seed, int polynomOrder, LsmBasisSystem.PolynomType polynomType, int nCalibrationSamples, SWIGTYPE_p_boost__optionalT_bool_t antitheticVariateCalibration, uint seedCalibration) : this(NQuantLibcPINVOKE.new_MCAmericanEngine__SWIG_0(GeneralizedBlackScholesProcess.getCPtr(process), traits, timeSteps, timeStepsPerYear, antitheticVariate, controlVariate, requiredSamples, requiredTolerance, maxSamples, seed, polynomOrder, (int)polynomType, nCalibrationSamples, SWIGTYPE_p_boost__optionalT_bool_t.getCPtr(antitheticVariateCalibration), seedCalibration), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }