Esempio n. 1
0
    def _cumulative_hazard(self, params, times):
        mu_, ln_sigma_, lambda_ = params
        sigma_ = exp(ln_sigma_)
        Z = (log(times) - mu_) / sigma_

        if lambda_ > 0:
            v = -gammainccln(1 / lambda_**2, exp(lambda_ * Z) / lambda_**2)
        else:
            v = -gammaincln(1 / lambda_**2, exp(lambda_ * Z) / lambda_**2)
        return v
Esempio n. 2
0
    def _log_1m_sf(self, params, times):
        mu_, ln_sigma_, lambda_ = params
        sigma_ = exp(ln_sigma_)

        Z = (log(times) - mu_) / sigma_
        if lambda_ > 0:
            v = gammaincln(1 / lambda_**2, exp(lambda_ * Z) / lambda_**2)
        else:
            v = gammainccln(1 / lambda_**2, exp(lambda_ * Z) / lambda_**2)
        return v
Esempio n. 3
0
 def _log_hazard(self, params, times):
     mu_, ln_sigma_, lambda_ = params
     ilambda_2 = 1 / lambda_**2
     Z = (log(times) - mu_) / exp(ln_sigma_)
     if lambda_ > 0:
         v = (log(lambda_) - log(times) - ln_sigma_ - gammaln(ilambda_2) +
              (lambda_ * Z - exp(lambda_ * Z) - 2 * log(lambda_)) *
              ilambda_2 - gammainccln(ilambda_2,
                                      exp(lambda_ * Z) * ilambda_2))
     else:
         v = (log(-lambda_) - log(times) - ln_sigma_ - gammaln(ilambda_2) +
              (lambda_ * Z - exp(lambda_ * Z) - 2 * log(-lambda_)) *
              ilambda_2 - gammaincln(ilambda_2,
                                     exp(lambda_ * Z) * ilambda_2))
     return v
Esempio n. 4
0
    def _log_hazard(self, params, times):
        mu_, ln_sigma_, lambda_ = params

        Z = (log(times) - mu_) / exp(ln_sigma_)
        if lambda_ > 0:
            v = (log(lambda_) - log(times) - ln_sigma_ -
                 gammaln(1 / lambda_**2) +
                 (lambda_ * Z - exp(lambda_ * Z) - 2 * log(lambda_)) /
                 lambda_**2 - gammainccln(1 / lambda_**2,
                                          exp(lambda_ * Z) / lambda_**2))
        else:
            v = (log(abs(lambda_)) - log(times) - ln_sigma_ -
                 gammaln(1 / lambda_**2) +
                 (lambda_ * Z - exp(lambda_ * Z) - 2 * log(abs(lambda_))) /
                 lambda_**2 - gammaincln(1 / lambda_**2,
                                         exp(lambda_ * Z) / lambda_**2))
        return v