I have two piecewise functions that are defined on values of [0,200]. I would like to find out the maximum difference between the two values.
The usual Max[] function does not work because all values the two piecewise functions are integer values and are discontinuous.
I tried this
FindMaxValue[EDFh4 - CDFh4, x]
EDFh4 and CDFh4 are the two functions defined as:
CDFh4 = Piecewise[{#1, #2 <= x < #3} & @@ # & /@ CDFh3]
EDFh4 = Piecewise[{#1, #2 <= x < #3} & @@ # & /@ EDFh3]
The functions have vertical and horizontal components, never at the same time.
CDFh3= {{1/30, 15, 30}, {1/15, 30, 40}, {1/10, 40, 50}, {2/15, 50, 60}, {1/5,
60, 70}, {4/15, 70, 85}, {3/10, 85, 90}, {1/3, 90, 105}, {11/30,
105, 110}, {7/15, 110, 120}, {8/15, 120, 125}, {17/30, 125,
130}, {19/30, 130, 135}, {2/3, 135, 140}, {11/15, 140, 150}, {4/5,
150, 160}, {5/6, 160, 175}}
EDFh3={{1/30, 10, 35}, {1/15, 35, 55}, {1/10, 55, 60}, {1/5, 60, 75}, {7/30,
75, 80}, {4/15, 80, 110}, {1/3, 110, 120}, {13/30, 120, 125}, {8/
15, 125, 130}, {19/30, 130, 135}, {7/10, 135, 140}, {11/15, 140,
145}, {4/5, 145, 150}, {5/6, 150, 165}, {9/10, 165, 180}, {14/15,
180, 185}, {29/30, 185, 190}}
CDF Values: https://i.sstatic.net/teKvX.png
EDF Values: https://i.sstatic.net/pXc3P.png
CDFh3
andEDFh3
to work with $\endgroup$