Sea \(X_1, ..., X_n \sim exp(\theta)\) y $ GI(,)$

se cumple que

\[ \theta | X_1, ..., X_n \sim GI(\alpha+n,\beta+t)\]

n1<-1664
n2<-23
m1<-8.41
m2<-16.51
t1<-n1*m1
t1
## [1] 13994.24
t2<-n2*m2
t2
## [1] 379.73

No informativa

Jefrey a=1

a1<-1
b1<-1
a2<-1
b2<-1
B<-5000
p1<-1/rgamma(B,a1+n1,b1+t1)
p2<-1/rgamma(B,a2+n2,b2+t2)
mean(p1)
## [1] 8.405855
mean(p2)
## [1] 16.65061

Diferencia entre p1 y p2

p1mp2<-p1-p2
plot(density(p1mp2))

quantile(p1mp2,c(0.025,0.975))
##       2.5%      97.5% 
## -16.641296  -2.737484
plot(density(p1mp2), main = "Distribución porterior de la diferencia de parámetros", xlab = "m1-m2", ylab = "f(m1-m2)", col =3,lwd = 4)
abline(v=quantile(p1mp2,0.025),col = 2,lwd = 4)
abline(v=quantile(p1mp2,0.975),col = 2,lwd = 4)
abline(v=0,col = 1,lwd = 4)