Learn R Programming

HistDAWass (version 1.0.4)

plotPredVsObs: A function for comparing observed vs predicted histograms

Description

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

Usage

plotPredVsObs(PRED, OBS, type = "HISTO", ncolu = 2)

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" (default), if ones want to compare histograms "CDF", if ones want to compare cumulative distribution functions; "DENS" if ones want to compare approximated densities (using KDE);

ncolu

number of columns in which is arranged the plot, default is 2. If you have a lot of data consider to choose higher values.

Value

A plot with compared histogram-valued data.

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
# }
# NOT RUN {
OBS=BLOOD[,1]
plotPredVsObs(PRED,OBS,"HISTO")
plotPredVsObs(PRED,OBS,"CDF")
plotPredVsObs(PRED,OBS,"DENS")
# }

Run the code above in your browser using DataLab