https://9pdf.net/document/qmj8kwvw-using-martingale-residuals-assess-goodness-sampled-risk-data.html