plot_errors: Plot the errors of predicted histograms

View source: R/Plotting_with_ggplot.R

plot_errorsR Documentation

Plot the errors of predicted histograms

Description

Plots the differences between observed and predicted histograms (e.g. from WH.regression.two.components.predict) and prints the root mean squared error based on the L2 Wasserstein distance.

Usage

plot_errors(PRED, OBS, type = "HISTO_QUA", np = 200)

Arguments

PRED

A MatH object with one column, the predicted histograms.

OBS

A MatH object with one column, the observed histograms.

type

The type of plot: "HISTO_QUA" (default, differences of the quantile functions), "HISTO_DEN" (differences of the densities) or "DENS_KDE" (differences of kernel density approximations).

np

The number of points used to compute the differences (default 200).

Value

The root mean squared error, invisibly. The plot is drawn on the current device.

See Also

plotPredVsObs, WH.regression.GOF

Examples

pars <- WH.regression.two.components(BLOOD, Yvar = 1, Xvars = c(2:3))
PRED <- WH.regression.two.components.predict(data = BLOOD[, 2:3], parameters = pars)
OBS <- BLOOD[, 1]
plot_errors(PRED, OBS, "HISTO_QUA")
plot_errors(PRED, OBS, "HISTO_DEN")
plot_errors(PRED, OBS, "DENS_KDE")

HistDAWass documentation built on Oct. 29, 2026, 5:07 p.m.