#include <oxstd.h>
#include <oxprob.h>

#include <lib/normtest.ox>

main()
{
    decl x1 = rann(200,1), x2 = ranchi(200,1,20);
	decl test1, test2, test1a, test2a;

    test1 = NormTest(x1);
    test2 = NormTest(x2);

    print("DH normality test of x1 ~ N(0,1) :  Chi(2) = ",
		test1, " [", "%.4f", tailchi(test1, 2), "]\n" );

    print("DH normality test of x1~Chi^2(20):  Chi(2) = ",
		test2, " [", "%.4f", tailchi(test2, 2), "]\n" );

    test1a = AsympNormTest(x1);
    test2a = AsympNormTest(x2);

    print("Large sample normality test of x1 ~ N(0,1) :  Chi(2) = ",
		test1a, " [", "%.4f", tailchi(test1a, 2), "]\n" );

    print("Large sample normality test of x1~Chi^2(20):  Chi(2) = ",
		test2a, " [", "%.4f", tailchi(test2a, 2), "]\n" );

//savemat("normtest.in7", x1 ~ x2);
}

