plot_errors: A function for plotting functions of errors

plot_errorsR Documentation

A function for plotting functions of errors

Description

This function allows the representation of the difference between observed histograms and the respective predicted ones. It can be used as a tool for interpreting preditive methods (for exampe, the regression of histogrma data)

Usage

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

Arguments

PRED

a MatH object with one column, the predicted data

OBS

a MatH object with one column, the observed data

type

a string. "HISTO_QUA" (default), if ones want to compare histograms quantile differences
"HISTO_DEN", if ones want to show the histogram densities differences;
"DENS_KDE" if ones want to show the differences between approximated densities (using KDE);

np

number of points considered for density or quantile computation (default=200).

Value

A plot with functions of differences between observed and predicted histograms, and a Root Mean Squared value computing by using the L2 Wasserstein distance.

Examples

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

Airpino/HistDAWass documentation built on Jan. 30, 2024, 7:53 p.m.