def lifetime_init(rule='1/e'):
    """Initialize a lifetime object.

    Parameters
    ----------
    rule : str {'1/e', 'trapz', 'simpson'}, optional
        Name of the method to integrate the correlation curve. \n
        '1/e' uses the 1/e rule and assumes an exponential decay. It linearly
        interpolates the time when the correlation goes below the value 1/e.
        When all values are > 1/e it returns the max lead time.
        When all values are < 1/e it returns the min lead time.\n
        'trapz' uses the trapezoidal rule for integration.\n
        'simpson' uses the Simpson's rule for integration.

    Returns
    -------
    out : dict
      The lifetime object.

    """
    list_rules = ['trapz', 'simpson', '1/e']
    if rule not in list_rules:
        raise ValueError("Unknown rule %s for integration.\n" % rule
                         + "The available methods are: "
                         + str(list_rules))

    lifetime = {}
    lifetime["lifetime_sum"] = 0.0
    lifetime["n"] = 0.0
    lifetime["rule"] = rule
    return lifetime