0

I want to get the data from a CDF, ideally in a list of probabilities and values. How do I do this?

I can plot the data but I can't see how to extract the raw data behind the plot. My pathetic attempt to extract the data failed.

data = RandomVariate[NormalDistribution[], 50];
D = EmpiricalDistribution[data];
{DiscretePlot[PDF[D, x], {x, data}], 
DiscretePlot[CDF[D, x], {x, -4, 4, .01}]}

An attempt to get the numerical data from the CDF:

N[CDF[D]]
Hefaestion
  • 437
  • 3
  • 8

1 Answers1

1

Don't use capital letters for your variables. For example, D is a reserved system variable. Replace with d. To get values,

Table[CDF[d, x], {x, -4, 4, .01}]

Worth looking at: What are the most common pitfalls awaiting new users?

bill s
  • 68,936
  • 4
  • 101
  • 191