2
$\begingroup$

I have plotted the PDF of a particular function using

Plot[PDF[NormalDistribution[64, 8.5333333], x], {x, 20, 100}]

This gives the curve

Distribution of 8000 data points

I want to find the probability of finding a data point in a particular region of this graph by integrating the area under the curve. I want to do this for a small section of the graph only, i.e. for a small range of values of $A_i$. How do I go about this?

$\endgroup$
1
  • $\begingroup$ Try Quantile? $\endgroup$ Commented Feb 16, 2018 at 9:39

2 Answers 2

4
$\begingroup$

That's what CDF is good for!

f = PDF[NormalDistribution[64, 8.5333333]];
F = CDF[NormalDistribution[64, 8.5333333]];
F[b] - F[a]

returns the area of the graph of f between the points a and b.

$\endgroup$
2
  • $\begingroup$ So if I want to find how many of my 8000 data points are in a region I just do (F[b]-F[a])*8000? $\endgroup$
    – JJH
    Commented Feb 16, 2018 at 10:12
  • $\begingroup$ Yepp........... $\endgroup$ Commented Feb 16, 2018 at 20:01
1
$\begingroup$

You can use the CDF function, e.g.

(* 5% one-tail probability *)
x = Quantile[NormalDistribution[0, 1], 0.05]

-1.64485

Show[Plot[PDF[NormalDistribution[0, 1], a], {a, -4, 4},
  Ticks -> {{{-4, "μ - 4σ"}, {-2, "μ - 2σ"},
     {2, "μ + 2σ"}, {4, "μ + 4σ"}}, None}],
 Plot[PDF[NormalDistribution[0, 1], b], {b, -4, x},
  PlotStyle -> None, Filling -> Axis]]

enter image description here

CDF[NormalDistribution[0, 1], x]

0.05

CDF returns 5%.

$\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.