1

In one experiment, participants can use a combination of strategy X and Y to solve problems. θ is the weight of X (ranging from 0 to 1, distributed as Beta), which can somehow be inferred from human data (perhaps no need to go into details here).

In a paper (p. 117)1 that I read, the authors reparameterized the Beta distribution of θ by its mean and standard deviation. How can I implement this in JAGS? Below is my attempt and I'm not sure if it's correct. If not, I wish to know what I should do instead.

model{
  for (i in 1:n) { # for each person
      theta[i] ~ dbeta(alpha, beta) # theta values come from data
  }
      alpha <- mu * phi
      beta <- (1-mu) * phi
      phi ~ dgamma(.1,.1)
      mu ~ dunif(0,1)
}

Thanks in advance and please let me know if there's any detail that I should add!

ramund
  • 185
  • 11

2 Answers2

0

If I understand you correctly, I think there's a misunderstanding with theta in your JAGS model. From your question it sounds like you're thinking of theta as a parameter? But in your model, you have theta as the data (sorry if I'm misinterpreting you). But regardless of that, you have reparameterized the beta distribution correctly by it's mean and variance by redefining alpha and beta such that, with your code above, you'll have E(x) = mu * phi and variance(x) = mu(1-mu)/(phi+1).

J. Calder
  • 1
  • 1
0

Are you looking for something like this?

a <- mu / (sd * sd)
b <- (1-mu) / (sd * sd)
theta ~ dbeta(a, b)

where mu is the mean, and sd is the standard deviation.

fjimenez
  • 88
  • 1
  • 8