Learn R Programming

HistDAWass (version 1.0.4)

plot_errors: 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

Run this code
# NOT RUN {
## 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")
# }

Run the code above in your browser using DataLab