I have a Bayesian statistics homework question that I'm not sure of:
Running this in R
, I got completely flat lines at 0
and 1
so I was thinking this meant that the success probability does not change with this particular prior. Can anyone shed some more light on this problem?
mu0 = 0
sig2_0 = 100
n = 10000
b0 = rnorm(n, mean=mu0, sd=sqrt(sig2_0))
x = seq(from=0, to=10, length.out=100)
res = matrix(0, length(x), 3)
for(i in 1:length(x)){
z = b0
z1 = exp(z) / (1+exp(z))
res[i,] = quantile(z1, c(0.025, 0.5, 0.975))
}
plot( x, res[,2], type='l', ylim=range(res), ylab='Success probability', xlab='Covariate')
lines(x, res[,1], lty=3)
lines(x, res[,3], lty=3)