@@ -437,142 +437,6 @@ let multivariateNormalTests =
437437 Expect.floatClose Accuracy.veryHigh 0.001451989663439 pdfs.[ 2 ] " Should be equal"
438438 ]
439439
440- //[<Tests>]
441- //let hypergeometricTests =
442-
443- // let hypergeoDistribution_basicCase = Distributions.DiscreteDistribution.hypergeometric 50 40 5
444- // let hypergeoDistribution_K_equal_n = Distributions.DiscreteDistribution.hypergeometric 50 20 20
445- // let hypergeoDistribution_max_K = Distributions.DiscreteDistribution.hypergeometric 50 50 20
446- // let hypergeoDistribution_max_n = Distributions.DiscreteDistribution.hypergeometric 50 20 50
447- // let hypergeoDistribution_max_K_n = Distributions.DiscreteDistribution.hypergeometric 50 50 50
448- // // 2022-06-23
449- // // https://hypergeon.wikipedia.org/wiki/Hypergeometric_distribution
450- // // N is population size,
451- // // K is the number of success states in the population,
452- // // n is the number of draws,
453- // // k is the number of observed successes
454- // // N ∈ {0,1,2,...}
455- // // K ∈ {0,1,2,...,N}
456- // // n ∈ {0,1,2,...,N}
457- // testList "Distributions.Discrete.Hypergeometric" [
458- // test "hypergeoCheckParam" {
459- // // Low N edge cases are difficult to test separately, as K and n MUST be smaller than N, but MUST also be bigger than 0
460- // let N_isZero = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam 0 1 1
461- // let N_isNegative = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam -2 1 1
462- // let N_isPositive = Distributions.Discrete.Hypergeometric.CheckParam 2 1 1
463- // //
464- // let K_isZero = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam 2 0 1
465- // let K_isNegative = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam 2 -2 1
466- // let K_positiveBiggerN = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam 2 3 1
467- // let K_positiveEqualN = Distributions.Discrete.Hypergeometric.CheckParam 2 2 1
468- // let K_positiveSmallerN = Distributions.Discrete.Hypergeometric.CheckParam 2 1 1
469- // //
470- // let n_isZero = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam 2 1 0
471- // let n_isNegative = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam 2 1 -2
472- // let n_positiveBiggerN = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam 2 1 3
473- // let n_positiveEqualN = Distributions.Discrete.Hypergeometric.CheckParam 2 1 2
474- // let n_positiveSmallerN = Distributions.Discrete.Hypergeometric.CheckParam 2 1 1
475- // Expect.throws N_isZero "N_isZero"
476- // Expect.throws N_isNegative "N_isNegative"
477- // Expect.equal N_isPositive () "N_isPositive"
478- // //
479- // Expect.throws K_isZero "K_isZero"
480- // Expect.throws K_isNegative "K_isNegative"
481- // Expect.throws K_positiveBiggerN "K_positiveBiggerN"
482- // Expect.equal K_positiveEqualN () "K_positiveEqualN"
483- // Expect.equal K_positiveSmallerN () "K_positiveSmallerN"
484- // //
485- // Expect.throws n_isZero "n_isZero"
486- // Expect.throws n_isNegative "n_isNegative"
487- // Expect.throws n_positiveBiggerN "n_positiveBiggerN"
488- // Expect.equal n_positiveEqualN () "n_positiveEqualN"
489- // Expect.equal n_positiveSmallerN () "n_positiveSmallerN"
490- // }
491- // test "hypergeoCheckParam_k" {
492- // let k_isNegative = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam_k 4 2 2 -2
493- // let k_isPositive = Distributions.Discrete.Hypergeometric.CheckParam_k 4 2 2 1
494- // let k_isPositive_allEqual = Distributions.Discrete.Hypergeometric.CheckParam_k 4 2 2 2
495- // let k_isPositiveBiggerN = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam_k 4 2 2 5
496- // let k_isPositiveBiggerK = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam_k 4 2 3 3
497- // let k_isPositiveBigger_n = fun (x:unit) -> Distributions.Discrete.Hypergeometric.CheckParam_k 4 3 2 3
498- // Expect.throws k_isNegative "k_isNegative"
499- // Expect.equal k_isPositive () "k_isPositive; should not throw."
500- // Expect.equal k_isPositive_allEqual () "k_isPositive_allEqual; should not throw."
501- // Expect.throws k_isPositiveBiggerN "k_isPositiveBiggerN"
502- // Expect.throws k_isPositiveBiggerK "k_isPositiveBiggerK"
503- // Expect.throws k_isPositiveBigger_n "k_isPositiveBigger_n"
504- // }
505- // // 2022-06-23
506- // // https://www.emathhelp.net/calculators/probability-statistics/hypergeometric-distribution-calculator/?pn=50&pk=40&sn=5&sk=5
507- // test "Mean" {
508- // Expect.floatClose Accuracy.high hypergeoDistribution_basicCase.Mean 4.0 "hyperDistribution_basicCase"
509- // Expect.floatClose Accuracy.high hypergeoDistribution_K_equal_n.Mean 8.0 "hyperDistribution_K_equal_n"
510- // Expect.floatClose Accuracy.high hypergeoDistribution_max_K.Mean 20.0 "hyperDistribution_max_K"
511- // Expect.floatClose Accuracy.high hypergeoDistribution_max_n.Mean 20.0 "hyperDistribution_max_n"
512- // Expect.floatClose Accuracy.high hypergeoDistribution_max_K_n.Mean 50.0 "hyperDistribution_max_K_n"
513- // }
514- // // 2022-06-23
515- // // https://www.emathhelp.net/calculators/probability-statistics/hypergeometric-distribution-calculator/?pn=50&pk=40&sn=5&sk=5
516- // test "Variance" {
517- // Expect.floatClose Accuracy.high hypergeoDistribution_basicCase.Variance 0.73469387755102 "hyperDistribution_basicCase"
518- // Expect.floatClose Accuracy.high hypergeoDistribution_K_equal_n.Variance 2.938775510204082 "hyperDistribution_K_equal_n"
519- // Expect.floatClose Accuracy.high hypergeoDistribution_max_K.Variance 0.0 "hyperDistribution_max_K"
520- // Expect.floatClose Accuracy.high hypergeoDistribution_max_n.Variance 0.0 "hyperDistribution_max_n"
521- // Expect.floatClose Accuracy.high hypergeoDistribution_max_K_n.Variance 0.0 "hyperDistribution_max_K_n"
522- // }
523- // // 2022-06-23
524- // // https://www.emathhelp.net/calculators/probability-statistics/hypergeometric-distribution-calculator/?pn=50&pk=40&sn=5&sk=5
525- // test "StandardDeviation" {
526- // Expect.floatClose Accuracy.high hypergeoDistribution_basicCase.StandardDeviation 0.857142857142857 "hyperDistribution_basicCase"
527- // Expect.floatClose Accuracy.high hypergeoDistribution_K_equal_n.StandardDeviation 1.714285714285714 "hyperDistribution_K_equal_n"
528- // Expect.floatClose Accuracy.high hypergeoDistribution_max_K.StandardDeviation 0.0 "hyperDistribution_max_K"
529- // Expect.floatClose Accuracy.high hypergeoDistribution_max_n.StandardDeviation 0.0 "hyperDistribution_max_n"
530- // Expect.floatClose Accuracy.high hypergeoDistribution_max_K_n.StandardDeviation 0.0 "hyperDistribution_max_K_n"
531- // }
532-
533- // // 2022-06-23
534- // // https://www.omnicalculator.com/statistics/hypergeometric-distribution
535- // test "PMF" {
536- // // test k = 0; Accuracy.medium, because online calculator has not enough decimal places.
537- // Expect.floatClose Accuracy.medium (hypergeoDistribution_basicCase.PMF 0) 0.00011894 "hyperDistribution_basicCase k=0"
538- // Expect.floatClose Accuracy.medium (hypergeoDistribution_K_equal_n.PMF 0) 0.0000006375 "hyperDistribution_K_equal_n k=0"
539- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_K.PMF 0) 0. "hyperDistribution_max_K k=0"
540- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_n.PMF 0) 0. "hyperDistribution_max_n k=0"
541- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_K_n.PMF 0) 0. "hyperDistribution_max_K_n k=0"
542- // // test any k
543- // Expect.floatClose Accuracy.medium (hypergeoDistribution_basicCase.PMF 3) 0.20984 "hyperDistribution_basicCase k=3"
544- // // Accuracy.low, because online calculator has not enough decimal places.
545- // Expect.floatClose Accuracy.low (hypergeoDistribution_K_equal_n.PMF 6) 0.1196 "hyperDistribution_K_equal_n k=6"
546- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_K.PMF 10) 0. "hyperDistribution_max_K k=10"
547- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_n.PMF 13) 0. "hyperDistribution_max_n k=44"
548- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_K_n.PMF 50) 1.0 "hyperDistribution_max_K_n k=50"
549- // }
550- // // 2022-06-23
551- // // https://www.omnicalculator.com/statistics/hypergeometric-distribution
552- // test "CDF" {
553- // Expect.floatClose Accuracy.medium (hypergeoDistribution_basicCase.CDF 3)0.2581 "hyperDistribution_basicCase k=3"
554- // // Accuracy.low, because online calculator has not enough decimal places.
555- // Expect.floatClose Accuracy.low (hypergeoDistribution_K_equal_n.CDF 7) 0.3858 "hyperDistribution_K_equal_n k=7"
556- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_K.CDF 14) 0.0 "hyperDistribution_max_K k=14"
557- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_n.CDF 3) 0.0 "hyperDistribution_max_n k=3"
558- // Expect.floatClose Accuracy.medium (hypergeoDistribution_max_K_n.CDF 3) 0.0 "hyperDistribution_max_K_n k=3"
559- // }
560- // //// No idea what this is meant for, but its Syntax differs from Bernoulli.Support
561- // //test "Support" {
562- // // /// 40 20 5 do not matter as long as they don't fail "hypergeoCheckParam"
563- // // let s = Distributions.Discrete.Hypergeometric.Support 40 20 5
564- // // Expect.equal s (0., infinity) ""
565- // //}
566- // test "SampleUnchecked" {
567- // let generateALL = Distributions.Discrete.Hypergeometric.Sample 40 20 40
568- // let generate50 = Array.init 50 (fun x -> Distributions.Discrete.Hypergeometric.Sample 40 20 10)
569- // let numbersAreBetween_1_K = generate50 |> Array.forall (fun x -> x >= 0 && x <= 10)
570- // // If N = n then k = K
571- // Expect.equal generateALL 20 "generateALL"
572- // Expect.isTrue numbersAreBetween_1_K "numbersAreBetween_1_K"
573- // }
574- // ]
575-
576440let exponentialTests =
577441 // references is R V. 2022.02.3 Build 492
578442 // PDF is used with expPDF <- dexp(3,0.59)
0 commit comments