sol2 - CSCI 5512: Homework 2 Solutions Eric Theriault...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Eric Theriault Spring 2010 Programming Notes All programming solutions are written in MATLAB. To be more useful to those students who wrote in C and Java, the solutions use loops instead of matrix operations. Note that these are only sample solutions and that other strategies can work. Problem 1 See m-Fles for example rejection sampling and likelihood weighting code. The estimates should be close to P ( r | s, w ) = 0 . 32. Likelihood weighting makes better use of samples because it only looks at samples consistent with the evidence and can therefore use all samples generated. Rejection sampling may generate samples that are inconsistent with the evidence, in which case it wastes these samples by discarding them. Problem 2 The numerical values are as follows: P ( C | r, w, s ) = a 0 . 444 , 0 . 556 A P ( C r, w, s ) = a 0 . 048 , 0 . 952 A P ( R | c, w, s ) = a 0 . 815 , 0 . 185 A P ( R c, w, s ) = a 0 . 216 , 0 . 784 A See the m-Fle for example Gibbs sampling code. The estimate should again be close to P ( r | s, w ) = 0 . 32. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

sol2 - CSCI 5512: Homework 2 Solutions Eric Theriault...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online