2
$\begingroup$

The Bayesian logistic regression model with beta priors seem to work using JAGS. I just can't find any examples of it in any literature or any tutorials. They all seem to use normal priors.

Just want to know there are any issues.

Model in JAGS (I have just changed a dnorm model to a dbeta one and I have put in uninformed priors):

model {
  for ( i in 1:Ntotal ) {
    # In JAGS, ilogit is logistic:
    y[i] ~ dbern( ilogit( zbeta0 + sum( zbeta[1:Nx] * zx[i,1:Nx] ) ) )
  }
  # Priors vague on standardised scale:
  zbeta0 ~ dbeta(1,1)
  for ( j in 1:Nx ) {
    zbeta[j] ~ dbeta(1,1)
  }
  # Transform to original scale:
  beta[1:Nx] <- zbeta[1:Nx] / xsd[1:Nx]
  beta0 <- zbeta0 - sum( zbeta[1:Nx] * xm[1:Nx] / xsd[1:Nx] )

  # Compute predictions at every step of the MCMC
  for ( k in 1:Npred){
    pred[k] <- ilogit(beta0 + beta[1] * xPred[k,1] + beta[2] * xPred[k,2] + beta[3] * xPred[k,3] + beta[4] * xPred[k,4])
  }
}

There are four variables - they are proportions in the domain [0,1] that try to predict a binary indicator.

$\endgroup$
9
  • 5
    $\begingroup$ Priors on the usual logistic coefficients? How do you know they are restricted to $[0,1]$? $\endgroup$ Commented Oct 1, 2020 at 12:27
  • $\begingroup$ I am using priors that are proportions (e.g. proportion of the population that is employed, proportion that lived at the same address five years ago) to classify regions in to urban and regional. $\endgroup$ Commented Oct 1, 2020 at 19:36
  • 1
    $\begingroup$ What about that fact makes you think that the regression coefficients have to be restricted to $[0,1]$? $\endgroup$
    – Dave
    Commented Oct 1, 2020 at 19:39
  • 1
    $\begingroup$ How would I implement what? By doubling the log-odds, I mean that the coefficient is $2$, which is not a matter of being Bayesian. $\endgroup$
    – Dave
    Commented Oct 1, 2020 at 20:11
  • 1
    $\begingroup$ Can you explain to us your model, with formulas? $\endgroup$ Commented Oct 1, 2020 at 22:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.