public MaxBasketPathPricer(SparseVector underlying, double discountFactor, bool useAntitheticVariance) : base(discountFactor, useAntitheticVariance) { if (underlying.Min() <= 0.0) { throw new ArgumentException(nameof(underlying)); } _underlying = underlying; }
private void InitializeGenerator(IContinuousRng generator, Matrix covariance) { SparseVector diagonal = covariance.Diagonal; if (Count != diagonal.Length) { throw new ArgumentException("TODO: Covariance matrix does not match number of assets"); } if (diagonal.Min() < 0.0) { throw new ArgumentException("TODO: Covariance matrix contains negative variance."); } ArrayGenerator = new RandomArrayGenerator(generator, covariance); }
///<summary> ///</summary> ///<param name="optionType"></param> ///<param name="underlying"></param> ///<param name="strike"></param> ///<param name="discountFactor"></param> ///<param name="useAntitheticVariance"></param> ///<exception cref="ArgumentException"></exception> public BasketPathPricer(Option.Type optionType, SparseVector underlying, double strike, double discountFactor, bool useAntitheticVariance) : base(discountFactor, useAntitheticVariance) { if (underlying.Min() <= 0.0) { throw new ArgumentException("TODO: Price of underlying(s) must be positive."); } if (strike <= 0.0) { throw new ArgumentException("TODO: Strike price must be positive."); } _optionType = optionType; _underlying = underlying; _strike = strike; }