We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello Can you help me? I don't understand how to do that:
/**
*/ class LineEx {
val Q1: Uniform = Uniform(-10.0, 10.0) val Q0: Uniform = Uniform(-10.0, 10.0)
val e1 = Normal(fx(Q1, Q0, 1.0), 0.5) val e2 = Normal(fx(Q1, Q0, 2.0), 0.5) val e3 = Normal(fx(Q1, Q0, 3.0), 0.5)
def fx(q1: Element[Double], q0: Element[Double], x: Double): Element[Double] = { q1 * Constant(x) ++ q0 }
def resolve(): Array[Double] = { e1.observe(1.0) e2.observe(0.5) e3.observe(2.0) val likliHood = e1 * e2 * e3 val priorDistribution = Q1 * Q0 val mg = MetropolisHastings(ProposalScheme.default, likliHood * priorDistribution) mg.start() val r = Array( mg.computeExpectation(Q1, (d: Double) => { println(s"Q1=${d}") d }), mg.computeExpectation(Q0, (d: Double) => { println(s"Q0=${d}") d }) ) mg.stop() mg.kill() r }
}
this code doesn't work
thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello
Can you help me?
I don't understand how to do that:
/**
*/
class LineEx {
val Q1: Uniform = Uniform(-10.0, 10.0)
val Q0: Uniform = Uniform(-10.0, 10.0)
val e1 = Normal(fx(Q1, Q0, 1.0), 0.5)
val e2 = Normal(fx(Q1, Q0, 2.0), 0.5)
val e3 = Normal(fx(Q1, Q0, 3.0), 0.5)
def fx(q1: Element[Double], q0: Element[Double], x: Double): Element[Double] = {
q1 * Constant(x) ++ q0
}
def resolve(): Array[Double] = {
e1.observe(1.0)
e2.observe(0.5)
e3.observe(2.0)
val likliHood = e1 * e2 * e3
val priorDistribution = Q1 * Q0
val mg = MetropolisHastings(ProposalScheme.default, likliHood * priorDistribution)
mg.start()
val r = Array(
mg.computeExpectation(Q1, (d: Double) => {
println(s"Q1=${d}")
d
}),
mg.computeExpectation(Q0, (d: Double) => {
println(s"Q0=${d}")
d
})
)
mg.stop()
mg.kill()
r
}
}
this code doesn't work
thanks!
The text was updated successfully, but these errors were encountered: