The model specifications:
Parameterized by p and r:
model {
for( i in 1 : N ) {
y[i] ~ dnegbin( p , r )
}
p ~ dbeta(1.001,1.001)
r ~ dgamma(0.01,0.01)
m <- r*(1-p)/p
v <- r*(1-p)/(p*p)
}
for( i in 1 : N ) {
y[i] ~ dnegbin( p , r )
}
p ~ dbeta(1.001,1.001)
r ~ dgamma(0.01,0.01)
m <- r*(1-p)/p
v <- r*(1-p)/(p*p)
}
Parameterized by m and r:
model {
for( i in 1 : N ) {
y[i] ~ dnegbin( p , r )
}
p <- r/(r+m)
r ~ dgamma(0.01,0.01)
m ~ dgamma(0.01,0.01)
v <- r*(1-p)/(p*p)
}
for( i in 1 : N ) {
y[i] ~ dnegbin( p , r )
}
p <- r/(r+m)
r ~ dgamma(0.01,0.01)
m ~ dgamma(0.01,0.01)
v <- r*(1-p)/(p*p)
}
Results:
Parameterized by p and r:
Parameterized by m and r:
The posteriors are a bit different for the two parameterizations, because I used "generic" priors without any attempt to transform them to be equivalent.
Thanks to John Davey for this pointer!
1 comment:
This is great. I'm going to try it with my data now. Thanks for the tip since this seems like a common problem I will encounter with my count data.
Cheers,
Dan
Post a Comment