Skip to content

Commit

Permalink
Removed duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Reposa committed Jan 9, 2015
1 parent c3bf7ae commit 96537a7
Showing 1 changed file with 0 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -743,26 +743,6 @@ class ContinuousTest extends WordSpec with Matchers {
alg.stop()
alg.kill
}

"produce the right probability when conditioned under Importance Sampling" in {
val sampleUniverse = Universe.createNew()
val nSamples = Beta(2, 5)("", sampleUniverse)
val samples = for (i <- 1 to 100)
yield nSamples.generateValue(nSamples.generateRandomness())

val universe = Universe.createNew()
val a = Uniform(0, 10)("a", universe)
val b = Uniform(0, 10)("b", universe)
for (sample <- samples) {
val beta = Beta(a, b)
beta.observe(sample)
}
val alg = Importance(200000, a, b)
alg.start()
alg.mean(a) should be(2.0 +- 0.5)
alg.mean(b) should be(5.0 +- 0.5)
}

}

// We can test Dirichlets using the special case where alpha.length = 2
Expand Down Expand Up @@ -906,27 +886,5 @@ class ContinuousTest extends WordSpec with Matchers {
alg.stop()
alg.kill
}

"produce the right probability when conditioned under Importance Sampling" in {
val sampleUniverse = Universe.createNew()
val nSamples = Dirichlet(1, 2, 3)("", sampleUniverse)
val samples = for (i <- 1 to 100)
yield nSamples.generateValue(nSamples.generateRandomness())

val universe = Universe.createNew()
val alpha1 = Uniform(0, 10)("a1", universe)
val alpha2 = Uniform(0, 10)("a2", universe)
val alpha3 = Uniform(0, 10)("a3", universe)
for (sample <- samples) {
val dirichlet = Dirichlet(alpha1, alpha2, alpha3)
dirichlet.observe(sample)
}
val alg = Importance(200000, alpha1, alpha2, alpha3)
alg.start()
alg.mean(alpha1) should be(1.0 +- 0.5)
alg.mean(alpha2) should be(2.0 +- 0.5)
alg.mean(alpha3) should be(3.0 +- 0.5)
}

}
}

0 comments on commit 96537a7

Please sign in to comment.