@@ -0,0 +1,1917 @@
+/*%0A * JaamSim Discrete Event Simulation%0A * Copyright (C) 2021 JaamSim Software Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.jaamsim.ProbabilityDistributions;%0A%0Aimport java.util.Arrays;%0A%0Apublic class StudentsTDistribution %7B%0A%0A%09private static int%5B%5D degreesOfFreedom = %7B%0A%09%09%09     1,     2,     3,     4,     5,     6,     7,     8,     9,    10,%0A%09%09%09    11,    12,    13,    14,    15,    16,    17,    18,    19,    20,%0A%09%09%09    21,    22,    23,    24,    25,    26,    27,    28,    29,    30,%0A%09%09%09    40,    50,    60,    80,   100,   120%7D;%0A%0A%09private static double%5B%5D confidenceIntervalFactor95 = %7B%0A%09%09%0912.710, 4.303, 3.182, 2.776, 2.571, 2.447, 2.365, 2.306, 2.262, 2.228,%0A%09%09%09 2.201, 2.179, 2.160, 2.145, 2.131, 2.120, 2.110, 2.101, 2.093, 2.086,%0A%09%09%09 2.080, 2.074, 2.069, 2.064, 2.060, 2.056, 2.052, 2.048, 2.045, 2.042,%0A%09%09%09 2.021, 2.009, 2.000, 1.990, 1.984, 1.980, 1.960%7D;%0A%0A%09/**%0A%09 * Return the Student's T factor corresponding to a 95%25 confidence interval for the specified%0A%09 * number of degrees of freedom.%0A%09 * Adapted from the Wikipedia article %22Student's t-distribution%22, downloaded July 1, 2021.%0A%09 * @param n - degrees of freedom%0A%09 * @return factor for a 95%25 confidence interval%0A%09 */%0A%09public static double getConfidenceIntervalFactor95(int n) %7B%0A%09%09int k = Arrays.binarySearch(degreesOfFreedom, n);%0A%09%09int index = (k %3E= 0) ? k : -k - 1;%0A%09%09return confidenceIntervalFactor95%5Bindex%5D;%0A%09%7D%0A%0A%7D%0A

add class 'StudentsTDistribution'