stat/all: reduce random size and test tolerance to decrease testing t… (#181)

* stat/all: reduce random size and test tolerance to decrease testing time.

We were generating a lot of random numbers, which is slow. Decrease the size of those random numbers, and in some cases increase the tolerance to compensate. In a couple cases, pull out code from testFullDist to allow for more fine-grained testing. This decrases:
distmat from 4.5s to 0.5s
distmv from 24.8s to 9s
distuv from 65.2s to 13s
samplemv from 2.8s to 1.2s
sampleuv from 3.5s to 2.1s
This commit is contained in:
Brendan Tracey
2017-08-07 18:09:24 -06:00
committed by GitHub
parent 73027c37a4
commit e5448cb39f
12 changed files with 73 additions and 42 deletions

View File

@@ -72,7 +72,7 @@ func TestF(t *testing.T) {
func testF(t *testing.T, f F, i int) {
const (
tol = 1e-2
n = 2e6
n = 1e5
bins = 50
)
x := make([]float64, n)
@@ -83,7 +83,7 @@ func testF(t *testing.T, f F, i int) {
checkProbContinuous(t, i, x, f, 1e-3)
checkMean(t, i, x, f, tol)
checkVarAndStd(t, i, x, f, tol)
checkExKurtosis(t, i, x, f, 5e-2)
checkSkewness(t, i, x, f, tol)
checkQuantileCDFSurvival(t, i, x, f, 1e-3)
checkExKurtosis(t, i, x, f, 1e-1)
checkSkewness(t, i, x, f, 5e-2)
checkQuantileCDFSurvival(t, i, x, f, 5e-3)
}