SELECT 
    asset_id,
    COUNT(*) AS failures,
    MIN(occurred_on) AS first_event,
    MAX(occurred_on) AS last_event,
    (julianday(MAX(occurred_on)) - julianday(MIN(occurred_on))) / 365.25 AS years_observed,
    COUNT(*) / ((julianday(MAX(occurred_on)) - julianday(MIN(occurred_on))) / 365.25) AS lambda_est
FROM events
WHERE occurred_on IS NOT NULL
GROUP BY asset_id
ORDER BY lambda_est DESC;