View source: R/predict_survival_curves.R
| threshold_x_by_draw | R Documentation |
Internal helper. For each row (draw) of pred_mat, finds the value of x
at which the predicted probability crosses target, via linear
interpolation. Returns one value per draw.
threshold_x_by_draw(pred_mat, x, target)
pred_mat |
Numeric matrix |
x |
Numeric vector of grid values along which to invert
(length = |
target |
Numeric scalar: the probability value to invert at. |
stats::approx() requires its x argument (here, the survival values) to
be monotonically increasing. Because the 4PL is monotonically decreasing
in duration (and in temperature for a fixed duration), we sort by p
ascending before calling approx().
Numeric vector of length nrow(pred_mat).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.