Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presentation of Question 3 Sun Jie U093351B. Prior1: Be(.5,.5) pv=seq(0.00001,0.05,0.00001) xv=51; nv=8197 logf1= (xv-.5)*log(pv)+(nv-xv-.5)*log(1-pv)

Similar presentations


Presentation on theme: "Presentation of Question 3 Sun Jie U093351B. Prior1: Be(.5,.5) pv=seq(0.00001,0.05,0.00001) xv=51; nv=8197 logf1= (xv-.5)*log(pv)+(nv-xv-.5)*log(1-pv)"— Presentation transcript:

1 Presentation of Question 3 Sun Jie U093351B

2 Prior1: Be(.5,.5) pv=seq( ,0.05, ) xv=51; nv=8197 logf1= (xv-.5)*log(pv)+(nv-xv-.5)*log(1-pv) f2=exp(logf1-max(logf1)) intf2=sum(f2)*(pv[2]-pv[1]) post=f2/intf2 prior=dbeta(pv,.5,.5) plot(pv, prior,col="red",ylim=range(0:500)) points(pv,post)

3 Prior1: Be(.5,.5)

4 Point Estimate pmean=sum(pv*post)/sum(post) pcdf=cumsum(post)/sum(post) pmedian=.5*(max(pv[pcdf.5])) pmode=pv[which.max(post)]

5 Interval Estimate CI1=c(max(pv[pcdf.975])) threshold=max(post) coverage=0 for(i in seq(.999,.001,-.001)) { threshold=i*max(post) within=which(post>=threshold) coverage=pcdf[max(within)]-pcdf[min(within)] if(coverage>=.95)break() } CI2=pv[range(within)]

6 > pmean [1] > pmedian [1] > pmode [1] > CI1 [1] > CI2 [1]

7 Prior2: N(1.5%,.25%) pv=seq( ,0.05, ) xv=51; nv=8197 logf1= xv*log(pv)+(nv-xv)*log(1-pv)-(pv-.015)^2/(2*.0025^2) f2=exp(logf1-max(logf1)) intf2=sum(f2)*(pv[2]-pv[1]) post=f2/intf2 prior=dnorm(pv,mean=.015,sd=.0025) plot(pv, prior,col="red",ylim=range(0:500)) points(pv,post)

8 Prior2: N(1.5%,.25%)

9 > pmean[1] > pmedian[1] > pmode[1] > CI1 [1] > CI2 [1]

10 Prior3: Exp(100) pv=seq( ,0.05, ) xv=51; nv=8197 logf1= xv*log(pv)+(nv-xv)*log(1-pv)-100*pv f2=exp(logf1-max(logf1)) intf2=sum(f2)*(pv[2]-pv[1]) post=f2/intf2 prior=dexp(pv,rate=100) plot(pv, prior,col="red",ylim=range(0:500)) points(pv,post)

11 Prior3: Exp(100) > pmean [1] > pmedian [1] > pmode [1] > CI1 [1] > CI2 [1]

12 Comparison > pmean [1] > pmedian [1] > pmode [1] > CI1 [1] > CI2 [1] Prior1: Be(.5,.5) > pmean[1] > pmedian[1] > pmode[1] > CI1 [1] > CI2 [1] Prior2: N(1.5%,.25%) Prior3: Exp(100) > pmean [1] > pmedian [1] > pmode [1] > CI1 [1] > CI2 [1]

13 Questions? Thank you.


Download ppt "Presentation of Question 3 Sun Jie U093351B. Prior1: Be(.5,.5) pv=seq(0.00001,0.05,0.00001) xv=51; nv=8197 logf1= (xv-.5)*log(pv)+(nv-xv-.5)*log(1-pv)"

Similar presentations


Ads by Google