1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.hipparchus.distribution.continuous;
23
24 import org.hipparchus.util.Precision;
25 import org.junit.Assert;
26 import org.junit.Test;
27
28
29
30
31 public class LogisticsDistributionTest extends RealDistributionAbstractTest {
32
33 @Test
34 public void testParameters() {
35 LogisticDistribution d = makeDistribution();
36 Assert.assertEquals(2, d.getLocation(), Precision.EPSILON);
37 Assert.assertEquals(5, d.getScale(), Precision.EPSILON);
38 }
39
40 @Test
41 public void testSupport() {
42 LogisticDistribution d = makeDistribution();
43 Assert.assertTrue(Double.isInfinite(d.getSupportLowerBound()));
44 Assert.assertTrue(Double.isInfinite(d.getSupportUpperBound()));
45 Assert.assertTrue(d.isSupportConnected());
46 }
47
48 @Override
49 public LogisticDistribution makeDistribution() {
50 return new LogisticDistribution(2, 5);
51 }
52
53 @Override
54 public double[] makeCumulativeTestPoints() {
55 return new double[] {
56 -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5
57 };
58 }
59
60 @Override
61 public double[] makeDensityTestValues() {
62 return new double[] {
63 0.03173698, 0.03557889, 0.03932239, 0.04278194, 0.04575685, 0.04805215,
64 0.04950331, 0.05000000, 0.04950331, 0.04805215, 0.04575685
65 };
66 }
67
68 @Override
69 public double[] makeCumulativeTestValues() {
70 return new double[] {
71 0.1978161, 0.2314752, 0.2689414, 0.3100255, 0.3543437, 0.4013123,
72 0.4501660, 0.5000000, 0.5498340, 0.5986877, 0.6456563
73 };
74 }
75
76 }
77