
Plot predictions and uncertainty displays for imputed trait values
Source:R/plot_pigauto.R
plot_uncertainty.RdFor continuous, count, and ordinal traits, plots conformal prediction
intervals when present; otherwise it shows an approximate
prediction +/- 1.96 * SE ribbon, sorted by predicted value.
If truth is supplied, observed values are overlaid as points.
For binary traits, the centre line is the predicted probability when
available. Binary predictions have no conformal bounds here. If bounds
are absent, this function still draws a ribbon using
min(p, 1-p), a probability-of-error score, as if it were an SE.
This binary ribbon is only a visual score display: it is not a calibrated
interval and has no stated coverage. Interpret the centre line as the
probability; do not interpret the ribbon as an uncertainty interval. See
predict.pigauto_fit for type-specific uncertainty meanings.
Arguments
- pred_result
list with
imputedandsecomponents (output ofpredict.pigauto_fit), or apigauto_resultfromimpute(its$predictionis used).- truth
matrix or data.frame of true values (same scale as
pred_result$imputed), orNULL.- trait_name
character. Which trait to plot (must match column name).
