
Last chance! 50% off unlimited learning
Sale ends in
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)
plotPredVsObs(PRED, OBS, type = "HISTO", ncolu = 2)
A plot with compared histogram-valued data.
a MatH
object with one column, the predicted data
a MatH
object with one column, the observed data
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);
number of columns in which is arranged the plot, default is 2. If you have a lot of data consider to choose higher values.
## 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
if (FALSE) {
OBS <- BLOOD[, 1]
plotPredVsObs(PRED, OBS, "HISTO")
plotPredVsObs(PRED, OBS, "CDF")
plotPredVsObs(PRED, OBS, "DENS")
}
Run the code above in your browser using DataLab