def test_muller_fit():
    variance = 0.1  # given in the ques
    rvs = generate_muller_rvs(variance)
    number_of_bins = int(1.88 * size(rvs)**(2 / 5.0))
    integrand = lambda x: stats.norm.pdf(x, scale=variance)
    writer.append('testing box-muller')
    gof.do_chi(rvs, number_of_bins, integrand)
Exemplo n.º 2
0
def test_gamma_fit():
    shape = 5  #given from hw1
    rvs = generate_gamma_rvs(shape)
    number_of_bins = int(1.88 * size(rvs)**(2 / 5.0))
    integrand = lambda x: stats.gamma(5).pdf(x)
    writer.append('testing gamma distribution')
    gof.do_chi(rvs, number_of_bins, integrand)
def test_muller_fit():
	variance = 0.1 # given in the ques
	rvs = generate_muller_rvs(variance)
	number_of_bins = int(1.88 * size(rvs) ** (2/5.0))
	integrand = lambda x : stats.norm.pdf(x, scale=variance)
	writer.append('testing box-muller')
	gof.do_chi(rvs, number_of_bins, integrand)
def test_cauchy_fit(sample_size):
    rvs = generate_cauchy_rvs(sample_size)
    number_of_bins = int(1.88 * size(rvs)**(2 / 5.0))
    integrand = lambda x: stats.gamma(5).pdf(
        x)  #cauchy was derived from gamma through the rejection method
    writer.append('testing cauchy distribution with ' + str(sample_size) +
                  ' samples')
    gof.do_chi(rvs, number_of_bins, integrand)
Exemplo n.º 5
0
def test_random_fit():
    rvs = generate_random_rvs()
    number_of_bins = int(1.88 * size(rvs)**(2 / 5.0))
    integrand = lambda x: 1  #pdf for uniform rv
    writer.append('testing random')
    gof.do_chi(rvs, number_of_bins, integrand)
def test_cauchy_fit(sample_size):
	rvs = generate_cauchy_rvs(sample_size)
	number_of_bins = int(1.88 * size(rvs) ** (2/5.0))
	integrand = lambda x : stats.gamma(5).pdf(x) #cauchy was derived from gamma through the rejection method
	writer.append('testing cauchy distribution with '+str(sample_size)+' samples')
	gof.do_chi(rvs, number_of_bins, integrand)
def test_lcg_fit():
	rvs = generate_lcg_rvs()
	number_of_bins = int(1.88 * size(rvs) ** (2/5.0))
	integrand = lambda x : 1 #pdf for uniform rv
	writer.append('testing lcg')
	gof.do_chi(rvs, number_of_bins, integrand)