How can I get the CDF for a list of values containing the value of a random variable and its probability?
I have:
grs[n_] := If[n == 14, 0.9^(n - 1)*0.1 + 0.9^14, 0.9^(n - 1)*0.1]
tableOfRandomVariable = Table[{n, grs[n]}, {n, 1, 14}]
hDist = HistogramDistribution[tableOfRandomVariable];
DiscretePlot[CDF[hDist, x], {x, 0, 14}, ExtentSize -> Right, ExtentMarkers -> {"Filled", "Empty"}]
It is not works.
When i try to do:
grs[n_] := If[n == 14, 0.9^(n - 1)*0.1 + 0.9^14, 0.9^(n - 1)*0.1]
tableOfRandomVariable = Table[grs[n], {n, 1, 14}] (*This list not contain random values, only probability list*)
hDist = HistogramDistribution[tableOfRandomVariable];
DiscretePlot[CDF[hDist, x], {x, 0, 14}, ExtentSize -> Right, ExtentMarkers -> {"Filled", "Empty"}]
I expect about:
But mathematica gives:
How I can get CDF plot for first table of variables?