1 / 7

Exercise #1

Exercise #1. Check the math in the example on slide 13. uniform(max(a,c), min(b,d)). Answer #1.

Télécharger la présentation

Exercise #1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Exercise #1 Check the math in the example on slide 13. uniform(max(a,c), min(b,d))

  2. Answer #1 Keep in mind that we’re interested in the proportionality (not the equality) of the expressions on the right sides of the equal sign. The distributions will be normalized anyway so it doesn’t matter what values any constants have. Thus, we can neglect the quotients with  in the denominators. When the binomial in θ and x is squared, you can also ignore the constant terms that emerge. This includes the 72 and also the x2 term. Do you see why? The transition in the last line from the exponential function to the normal distribution goes like this: exp((–3θ2 + 50 θ)/4) exp(–¾(θ2 – (50/3) θ)) exp(–¾ (θ2 – (50/3) θ))  exp(–¾(252/32)) (ok to multiply by any constant) exp(–¾ (θ2 – (50/3) θ + 252/32)) exp(–¾ (θ – (25/3))2) exp(–(θ – (25/3))2 / (4/3)) exp(–(θ – (25/3))2 / (2 * ⅔)) which is, apart from the normalizing quotient involving root , a normal distribution with μ = 25/3 and σ2 = ⅔. uniform(max(a,c), min(b,d))

  3. Exercise #2 Sketch [P,P] for {-,B,G,B,B,G,R,G,…, (35/100)R, …, (341/1000)R}. uniform(max(a,c), min(b,d))

  4. 100 1000 100 1000 Answer #2 // Walley's (1996) bag of marbles // the data is {-,B,G,B,B,G,R,G,…,(35/100)R,…(341/1000)R // the formula is p = [nj / (N + s), (nj + s)/(N + s)] func pp() return [$1/($2+$3), ($1+$3)/($2+$3)] s = 2 for n = 0 to 5 do say n, tab, pp(0, n, s) 0 [ 0, 1] 1 [ 0, 0.66667] 2 [ 0, 0.5] 3 [ 0, 0.4] 4 [ 0, 0.33334] 5 [ 0, 0.28572] pp(1,6,s) [ 0.125, 0.375] pp(1,7,s) [ 0.11111, 0.33334] pp(35,100,s) [ 0.34313, 0.36275] pp(341,1000,s) [ 0.34031, 0.34232] //could also do it for another s s = 1 for n = 0 to 5 do say n, tab, pp(0, n, s) 0 [ 0, 1] 1 [ 0, 0.5] 2 [ 0, 0.33334] 3 [ 0, 0.25] 4 [ 0, 0.2] 5 [ 0, 0.16667] pp(1,6,s) [ 0.14285, 0.28572] pp(1,7,s) [ 0.125, 0.25] pp(35,100,s) [ 0.34653, 0.35644] pp(341,1000,s) [ 0.34065, 0.34166] // the formula is p = [nj / (N + s), (nj + s)/(N + s)] func pp() return [$1/($2+$3), ($1+$3)/($2+$3)] s = 2 for n = 0 to 5 do say tab, n, tab, pp(0, n, s) 0 [ 0, 1] 1 [ 0, 0.66667] 2 [ 0, 0.5] 3 [ 0, 0.4] 4 [ 0, 0.33334] 5 [ 0, 0.28572] pp(1,6,s) [ 0.125, 0.375] pp(1,7,s) [ 0.11111, 0.33334] pp(35,100,s) [ 0.34313, 0.36275] pp(341,1000,s) [ 0.34031, 0.34232] uniform(max(a,c), min(b,d))

  5. Exercise #3 What can be said about the posterior if the prior is uniform(a,b) and the likelihood function is an a non-zero constant for values of  between c and d and zero elsewhere? Sketch the answer for a = 2, b = 14, c = 5, d = 21. What is the posterior if a [1,3], b [11,17], c [4,6], d [20,22]? uniform(max(a,c), min(b,d))

  6. a = 2 b = 14 c = 5 d = 21 prior = uniform(a, b) likelihood = uniform(c, d) posterior = uniform(max(a,c), min(b,d)) posterior ~uniform(range=[5,14], mean=9.5, var=6.75) a = [1,3] b = [11,17] c = [4,6] d = [20,22] prior = uniform(a, b) likelihood = uniform(c, d) posterior = uniform(max(a,c), min(b,d)) posterior uniform(max(a,c), min(b,d)) ~uniform(range=[4,17], mean=[7.5,11.5], var=[4,10.1]) Answer #3 The posterior would be uniform(max(a,c), min(b,d)), that is, a uniform ranging from the lesser of a and c to the greater of b and d. In the first case, the posterior would be a uniform (flat density, straight line cumulative) between 5 and 14. The graphs below illustrate this case. uniform(max(a,c), min(b,d))

  7. a = 2 b = 14 c = 5 d = 21 prior = uniform(a, b) likelihood = uniform(c, d) posterior = uniform(max(a,c), min(b,d)) posterior ~uniform(range=[5,14], mean=9.5, var=6.75) a = [1,3] b = [11,17] c = [4,6] d = [20,22] prior = uniform(a, b) likelihood = uniform(c, d) posterior = uniform(max(a,c), min(b,d)) posterior uniform(max(a,c), min(b,d)) ~uniform(range=[4,17], mean=[7.5,11.5], var=[4,10.1]) Answer #3 (continued) In the second case, the posterior would be the class of uniforms whose minima are within the interval [4,6] and whose maxima are within the interval [11,17], i.e., any straight line inside the gray bounds from zero to one is a possible posterior from this analysis. Notice that the same formula uniform(max(a,c), min(b,d)) works when a, b, c and d are intervals.

More Related