Ejemplo n.º 1
0
        //! default theta calculation for Black-Scholes options
        public static double blackScholesTheta(GeneralizedBlackScholesProcess p, double value, double delta, double gamma)
        {
            double u = p.stateVariable().currentLink().value();
            double r = p.riskFreeRate().currentLink().zeroRate(0.0, Compounding.Continuous).rate();
            double q = p.dividendYield().currentLink().zeroRate(0.0, Compounding.Continuous).rate();
            double v = p.localVolatility().currentLink().localVol(0.0, u, false);

            return(r * value - (r - q) * u * delta - 0.5 * v * v * u * u * gamma);
        }