plot_errors {HistDAWass} | R 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 |
OBS |
a |
type |
a string. "HISTO_QUA" (default), if ones want to compare histograms quantile differences |
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")