ST35 Workng backwards wth condtonal probablty ST35 Week 8
Roll two reg dce. One s 6; Pr(other s 6)? AR smulaton gves Y t = 3. Dst of Y t-? Y t = = Y t- + t ; t ~ N(0,) =? =0.5 ST35 Week 8
Sally Clarke Pr( nnocent SDS deaths) = ( n 8700) SDS Pr(Not nnocent?) ST35 Week 8 3
Sample Survey n 000 Precson 0.03 Approx 95%CI pˆ 0.03 RedC Prop(Satsfed by Kenny) = 0.43 Pr 0.40 p 0.46 0.95?? ˆ Theory p n X X Number ( Yes) X B( n, p) CLT pˆ N p, SE pˆ app p( p) SE pˆ 0.5 ( n 000, p 0.5) n Pr p (0.5) pˆ p (0.5) 0.95 Pr pˆ (0.5) p pˆ (0.5) 0.95 ST35 Week 8 4
Squrrels squrrels. Nut posonous f eat > half Frst eats random prop U(0,) Second eats random prop U(0,) of remander One survves: Pr(Other survves)? Frst eats 0.05 Pr(Second eats >0.5)? Second eats 0.05 Pr(Frst eats > 0.5)? ST35 Week 8 5
Squrrels Z Z P P fatal? fatal? 0.057 0.59 0.057 0.557 FALSE TRUE 0.870 0.6 0.870 0.09 TRUE FALSE 3 0.679 0.467 0.679 0.50 TRUE FALSE 4 0.555 0.66 0.555 0.75 TRUE FALSE 5 0.909 0.985 0.909 0.090 TRUE FALSE 6 0.539 0.893 0.539 0.4 TRUE FALSE Fatal Fatal TRUE FALSE TRUE 0.00 0.53 0.53 FALSE 0.5 0.3 0.48 0.5 0.85.00 Smple: both unform: p= z, p = z P P avg 0.5 0.5 var 0.09 0.05 cov p p -0.04 Margnal cdf Jont pdf va scatterplot Theory E[] 0.50 0.5 Var 0.08 0.05 Cov -0.04 ST35 Week 8 6
Squrrels Cond Dsts Cond cdf of P gven value of P Cond cdf of P gven value of P Both straght lnes (Unform) Why? ST35 Week 8 7
Squrrels Theory Forward smpler than Backward Jont Dst Margnal Dsts Jont pdf va scatterplot Condtonal Dsts ST35 Week 8 8
Squrrels Theory: U(0,) f p 0 p P f p p 0 p p P P p f p, p p 0 p ;0 p p PP ln p f p p dp of course P P p 0 F p p p p 0 of course f p p dp ln p 0 p P F p p p P Jont and Margnal dstrbutons ST35 Week 8 9
Squrrels Theory U(0,) ; VarP E P ln ln 4 0 0 E P p p dp p p p 3 3 9 0 0 E P p ln p dp p ln p p ; Var P 9 6 E PP p p p dp dp 0 p ;0 p p p p dp p 0 Cov P, P 4 ExpVals, Vars, Cov ST35 Week 8 0
Squrrels Theory U(0,) Pr( P ) ; Pr( P ) ln 0.5 Snce necessarly ( P ) ( P ) and vce versa Pr( P, P ) 0 and Pr( P, P ) 0.35 Cond Dst P P f, ln p p PP f p p 0 p p P P p f p p P ln f p, p ln( p ) f p p P PP F p 0 p p P P p ST35 Week 8
Normalsng Constant P easy U 0, P P p easy U 0, p Pr Pr Pr A BPrB A and B B APr A f P P p p f PP all p P, f p f p P P p P P, P P p P p dp P P P p p f p f p f p p f p f p f ST35 Week 8
SIR Samplng - Importance Resamplng Objectve Sample Y from cts pdf f y h( y) Y not smply avalable ; but smple to sample X from sutable f x Sample n values x of X For each compute ( ) r( x ) hx ( ) f x ( ) s r( x ) rx ( ) ( ) w( x ) s 3 Re-sample m values Y from dscrete dst Poss values of Y Probs Pr Y x w( x ) x X X Typcally x,y multvarate. Illustrated by unvarate ST35 Week 8 3
LLN Recall Law Large Numbers Expected Values Sample Mean x d samples of random varable X x E X xf x dx n n X x g x E g X g x f x dx n n X x CLT n, n X N E X Var X n 95% of values of x E X SD X n n 95% of values of g x E g X SD g X n ST35 Week 8 4
Normalsng Const by Ratos f y h y Y Sutable x Sample n values x of X 3 n s avg r( x ) f X ( ) not avalable explctly avalable; smple to sample For each compute ( ) r( x ) hx ( ) ( ) s r( x ) f X x ST35 Week 8 5
Normalsng Const by Ratos Proof h x fx x nr x all y X y h y h ydy f X ydy all y all y fx E r X ( ) X f x dx r x f x dx all y f well defned LLN Propertes of cgce to E r( X ) depend on Var r( X ) Ratos all equal smpler methods avalable ST35 Week 8 6
Normalsng Const: Dscrete Dscrete by SIR (Ilustraton, never needed) Poss Y 0 3 Normalsng Const f(y)h(y) 3 0.5 6.5 f(x) 0.5 0.5 0.5 0.5 Sum Avg ratos 6574 rato 6.574 for VLOOKUP cumwtsx X rato w 0 3 3 0.000 3E-04 0 0 8 0.00 0.00 0 3 4 0.00 0.00 0 4 0.00 0.004 0 5 4 0.00 0.005 0 999 4 0.00 0.998 3 000 0.00 ST35 Week 8 7
Normalsng Const: Contnuous y * Eg f y e y Usng eg x f x e y 0 * Y X rx ( ) 0 Here can show.53 From theory of 3?? y 0 Y e e x e x Quadratc Eg f y e y Theory.53 Ag Rato Sum rato.67 67.3 X f X (x) f Y (x) Rato Wts 0.79 0.757 0.96.7 0.00.63 0.83 0.450.593 0.00 3 0.584 0.558 0.843.5 0.00 4 0.359 0.698 0.937.343 0.00 5 4.944 0.007 0.000 0.00 0.000 000 0.973 0.378 0.63.648 0.00 ST35 Week 8 8
SIR Theory Y a n a n r x Y Dscrete Dst Pr Y x r x ;, n r x Pr r x r x I x wth I x f x a; else x a a x a xa x x Y Y X xa r x I x E r X I X n r x E r X Y x a X r x I x f x dx r x f x dx a X X xa r x f x dx r x f x dx f f x dx x dx f y dy as requred 0 ST35 Week 8 9
SIR - Weghted Bootstrap Squrrels To study dst of P gven P =0.7 Generate many P Resample, preferentally those P for whch P =0.7 s lkely More generally To thnk backwards gven evdence/data Generate many potental predecessors/causes Resample, preferrng those for whch data s lkely ST35 Week 8 0
AR model: Y t gven Y t+ =3 Sample Y t Eg by samplng recursvely Ft dstrbuton pdf (Y t ) For each Y t Compute pdf (Y t+ =3 Y t ) Form ratos Resample, preferrng Y t for whch Y t+ =3 s lkely alpha = Summares Theory 0.9 Mean -0.0 E[Y] 0 Var 5.78 Var[Y] 5.6 But gven that everythng s Gaussan ST35 Week 8
AR model: Y t gven Y t+ =3 pdf Y N t y 0 0, exp y y y y 3 pdf Y Y 3 N 3, exp t t 6 Rato r y exp y y y s 3, s r y pdf N s y and prop const avalable ST35 Week 8
AR model: Y t gven Y t+ =3 Smpler, gven Gaussan Y 0 t BVN, ; y y Y t 0 3 3, Y Y 3 N 3, Y Y N cf Y Y t t y t t t t t y ST35 Week 8 3
SIR and Cond Dsts Recall Propertes of cgce to E r( X ) depend on Var r( X ) Natural for cond dsts ST35 Week 8 4
Workng backwards Data y ( aspects of )process that gave rse to y? Model Seek Procedure y realsaton of rv Y Y can be smulated; data generatng system aspects of system prob dst f Y Y values of parameters ; y ST35 Week 8 5 DGS Z Y pdf f y Y transform Z Y Smulate random from f knowledge, absent data Prefer values for whch lkelhood of these data s hgh ; Pr ; f y Y y L y OR equvalent, f algebra/models smple Y