mitsuba-af602c6fd98a/src/tests/test_random.cpp
/* Binned version of a Chi-squared test */
Binned version of a Chi-squared test
Binned version of a Chi - squared test
void TestRandom::test04_uniform_distribution()
{
	const int N = 1000;
	const double alpha = 0.01;
	const double alpha_pvals = 0.0001;
	const double alphaT = sidak_correction(alpha, N);
	Log(EDebug, "Original alpha: %g, adjusted: %g", alpha, alphaT);
	ref<Random> rnd = new Random;
	UnifromTestPVals pTest;
	for (int i = 0; i < N; ++i) {
		const double pval = uniform_distribution_instance(rnd, alphaT);
		pTest.add(pval);
	}
	const double pval = pTest.pval();
	Log(EDebug, "Level 2 chi-squared pval: %g", pval);
	assertFalse(pval < alpha_pvals);
}
void TestRandom :: test04_uniform_distribution ( ) { const int N = 1000 ; const double alpha = 0.01 ; const double alpha_pvals = 0.0001 ; const double alphaT = sidak_correction ( alpha , N ) ; Log ( EDebug , " " , alpha , alphaT ) ; ref < Random > rnd = new Random ; UnifromTestPVals pTest ; for ( int i = 0 ; i < N ; ++ i ) { const double pval = uniform_distribution_instance ( rnd , alphaT ) ; pTest . add ( pval ) ; } const double pval = pTest . pval ( ) ; Log ( EDebug , " " , pval ) ; assertFalse ( pval < alpha_pvals ) ; }
Binned version of a Chi-squared test
Binned version of a Chi - squared test