Skip to content

TemporalHazard 1.2.15

Choose a tag to compare

@ehrlinger ehrlinger released this 12 Oct 22:10
· 73 commits to main since this release
db4934d

Bug fixes

  • A multiphase fit no longer selects a start that ran away to an
    underflow (#600).
    For an early phase with m = 0 and nu < 0,
    hzr_decompos() computed the CDF as 1 - exp(-x), which rounds to
    exactly 0 once x is below about 1e-16, while the density, formed
    directly, stayed positive. Where that happened the cumulative hazard
    vanished and the hazard did not, so the likelihood had a false peak that
    rose without bound in mu. On the avc data, the m-fixed model started
    from t_half = 0.5, nu = 1, mu = 1 with the default five starts
    climbed it to log(mu) 130 and a log-likelihood of +6380.86, and returned
    that start as the fit with converged = TRUE; three of the other four
    reach -214.875. The CDF is now -expm1(-x), as the m > 0, nu < 0
    branch already had it, and the same call returns -214.875. The two forms
    round differently everywhere, not only near 0, so other fits with an
    m = 0, nu < 0 phase can change in their last digits (by about 1e-15
    relative); fits without one are unchanged.

Tests

  • Two tests now pin the speed-up from 1.2.14's CoE gradient cache (#631).
    One counts the per-phase work and checks that a call matching the cache
    key does none, and that changing any one of theta, the times or the
    entry times alone forces it. The other runs a real CoE fit and checks that
    the second gradient evaluation at each point reuses the first's cache and
    does no work. The existing test compared gradients, which a recomputed
    value matches too, so it passed with caching switched off, with theta,
    the times or the entry times dropped from the key, and with the CoE
    wrapper handing its second evaluation a fresh cache. The new tests fail on
    each of those.