@@ -667,12 +667,8 @@ of applications in statistics.
667
667
668
668
.. method:: NormalDist.overlap(other)
669
669
670
- Compute the `overlapping coefficient (OVL)
671
- <http://www.iceaaonline.com/ready/wp-content/uploads/2014/06/MM-9-Presentation-Meet-the-Overlapping-Coefficient-A-Measure-for-Elevator-Speeches.pdf>`_
672
- between two normal distributions, giving a measure of agreement.
673
- Returns a value between 0.0 and 1.0 giving `the overlapping area for
674
- the two probability density functions
675
- <https://www.rasch.org/rmt/rmt101r.htm>`_.
670
+ Returns a value between 0.0 and 1.0 giving the overlapping area for
671
+ the two probability density functions.
676
672
677
673
Instances of :class:`NormalDist` support addition, subtraction,
678
674
multiplication and division by a constant. These operations
@@ -734,16 +730,6 @@ Find the `quartiles <https://en.wikipedia.org/wiki/Quartile>`_ and `deciles
734
730
>>> [round(sat.inv_cdf(p / 10)) for p in range(1, 10)]
735
731
[810, 896, 958, 1011, 1060, 1109, 1162, 1224, 1310]
736
732
737
- What percentage of men and women will have the same height in `two normally
738
- distributed populations with known means and standard deviations
739
- <http://www.usablestats.com/lessons/normal>`_?
740
-
741
- >>> men = NormalDist(70, 4)
742
- >>> women = NormalDist(65, 3.5)
743
- >>> ovl = men.overlap(women)
744
- >>> round(ovl * 100.0, 1)
745
- 50.3
746
-
747
733
To estimate the distribution for a model than isn't easy to solve
748
734
analytically, :class:`NormalDist` can generate input samples for a `Monte
749
735
Carlo simulation <https://en.wikipedia.org/wiki/Monte_Carlo_method>`_:
@@ -754,11 +740,12 @@ Carlo simulation <https://en.wikipedia.org/wiki/Monte_Carlo_method>`_:
754
740
... return (3*x + 7*x*y - 5*y) / (11 * z)
755
741
...
756
742
>>> n = 100_000
757
- >>> X = NormalDist(10, 2.5).samples(n)
758
- >>> Y = NormalDist(15, 1.75).samples(n)
759
- >>> Z = NormalDist(5, 1.25).samples(n)
743
+ >>> seed = 86753099035768
744
+ >>> X = NormalDist(10, 2.5).samples(n, seed=seed)
745
+ >>> Y = NormalDist(15, 1.75).samples(n, seed=seed)
746
+ >>> Z = NormalDist(50, 1.25).samples(n, seed=seed)
760
747
>>> NormalDist.from_samples(map(model, X, Y, Z)) # doctest: +SKIP
761
- NormalDist(mu=19.640137307085507 , sigma=47.03273142191088 )
748
+ NormalDist(mu=1.8661894803304777 , sigma=0.65238717376862 )
762
749
763
750
Normal distributions commonly arise in machine learning problems.
764
751
0 commit comments