# How to implement Exponential Power distribution in JAGS

I would like to fit a simulated data to Exponential Power likelihood using uniform mixture with gamma mixing presented in "Scale Mixtures Distributions In Statistical Modelling" by Choy and Chan: $$EP(x|\mu,\sigma,\beta) = \frac{c_1}{\sigma}exp(-|\frac{c_0^{1/2}(x-\mu)}{\sigma}|^{\frac{2}{\beta}})$$, where $$c_0 = \frac{\Gamma(3\beta/2)}{\Gamma(\beta/2)}, c_1=\frac{c_0^{1/2}}{\beta\Gamma(\beta/2)}$$ are fixed functions of $$\beta$$. According to the authors the sampling hierarchy is $$X|\mu,\sigma^2,\beta,u\sim U(\mu-\frac{\sigma}{\sqrt{2c_0}}u^{\beta/2},\mu+\frac{\sigma}{\sqrt{2c_0}}u^{\beta/2})$$ , $$u|\beta\sim Ga(1+\frac{\beta}{2},2^{-1/\beta})$$. I used JAGS in R with the below codes

Y <- rnorm(1000)
N <- length(Y)
jagsscript = cat("
model{

for(i in 1:N){
Y[i] ~ dunif(mu - d[i], mu + d[i])
d[i] <- tau/pow(2*c0,0.5)*pow(u[i],beta/2)
u[i] ~ dgamma(1+beta/2,pow(2,-1/beta))
}
#prior
beta ~ dunif(0.0001,2)
sigma ~ dgamma(0.01,0.01)
tau <- 1/sqrt(sigma)
mu ~ dnorm(0,0.0001)
c0 <- exp(loggam(3*beta/2)-loggam(beta/2))
}",file=model.loc)


Now I am stuck because I can't get this model to run since I might have Y observed outside of the boundaries of the uniform distribution. Is there a way to avoid this from happening or is there any better way to use JAGS to model an exponential power likelihood? Any help would be appreciated!