I would please like to ask for how to cumulate and plot the difference between cumulative disitribution functions (:=CDFs).
Example:
prob = {0.1, 0.2, 0.4, 0.2, 0.1}
(* Define distributions *)
empA = EmpiricalDistribution[prob -> {0, 0.5, 1, 2, 3}]
empB = EmpiricalDistribution[prob -> {-0.5, -0.25, 1.5, 3, 4}]
(* Plot cumulative distribution functions *)
CDFA = DiscretePlot[CDF[empA][x], {x, -1, 5, 0.25}, Frame -> True,
ExtentSize -> Right, ExtentMarkers -> {"Filled", "Empty"},
PlotRange -> {0, 1.1}, PlotStyle -> {Blue}]
CDFB = DiscretePlot[CDF[empB][x], {x, -1, 5, 0.25}, Frame -> True,
ExtentSize -> Right, ExtentMarkers -> {"Filled", "Empty"},
PlotRange -> {0, 1.1}, PlotStyle -> {Red}]
(* Plot difference between cumulative distribution functions *)
DELTA = DiscretePlot[CDF[empB][x] - CDF[empA][x], {x, -1, 5, 0.25},
Frame -> True, ExtentSize -> Right,
ExtentMarkers -> {"Filled", "Empty"}, PlotRange -> {-0.5, 0.5},
PlotStyle -> {Green}]
Considering DELTA, I would like to obtain and plot its cumulative value over x as specified.