Exemple #1
0
        /*! survival probability calculation
         * implemented in terms of the hazard rate \f$ h(t) \f$ as
         * \f[
         * S(t) = \exp\left( - \int_0^t h(\tau) d\tau \right).
         * \f]
         *
         * \warning This default implementation uses numerical integration,
         *          which might be inefficient and inaccurate.
         *          Derived classes should override it if a more efficient
         *          implementation is available.
         */
        protected override double survivalProbabilityImpl(double t)
        {
            GaussChebyshevIntegration integral = new GaussChebyshevIntegration(48);

            // this stores the address of the method to integrate (so that
            // we don't have to insert its full expression inside the
            // integral below--it's long enough already)

            // the Gauss-Chebyshev quadratures integrate over [-1,1],
            // hence the remapping (and the Jacobian term t/2)
            return(Math.Exp(-integral.value(hazardRateImpl) * t / 2.0));
        }
      /*! survival probability calculation
         implemented in terms of the hazard rate \f$ h(t) \f$ as
         \f[
         S(t) = \exp\left( - \int_0^t h(\tau) d\tau \right).
         \f]

         \warning This default implementation uses numerical integration,
                  which might be inefficient and inaccurate.
                  Derived classes should override it if a more efficient
                  implementation is available.
      */
      protected override double survivalProbabilityImpl(double t)
      {
         GaussChebyshevIntegration integral = new GaussChebyshevIntegration(48);
        // this stores the address of the method to integrate (so that
        // we don't have to insert its full expression inside the
        // integral below--it's long enough already)

        // the Gauss-Chebyshev quadratures integrate over [-1,1],
        // hence the remapping (and the Jacobian term t/2)
        return Math.Exp(-integral.value(hazardRateImpl) * t/2.0);
        // return 0;
      }