0
$\begingroup$

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]]
$\endgroup$
0

1 Answer 1

1
$\begingroup$

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?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.