model {
	### Calculate x from log x
	for (i in 1:N) {
		x[i] <- pow(10, log10x[i])
	}
	
	### Calibration data
	# Each ISE emf response is based on x and a, b, c, and tau for the particular ISE
	for (i in 1:N) {
		emf[i] ~ dnorm(mu.emf[i], Tau[i])
		mu.emf[i] <- a + b *log(x[i] + c)/log(10)
		Tau[i] <- tau
	}
	
	### Priors for the ISE model
	a ~ dnorm(0, 0.000001)
	
	###########################
	# ISE-specific priors     #
	b ~ dnorm(mu.b, 0.01)     #
	cstar ~ dunif(0.1, 0.5)   #
	sigma ~ dunif(0,10)       #
	###########################

	# Logical nodes
	c <- pow(cstar, 10)	
	logsigma <- log(sigma)
	tau <- 1/(sigma*sigma)

	# Separate ISE parameter estimation from sample calibration
	a.cut <- cut(a)
	b.cut <- cut(b)
	c.cut <- cut(c)
	tau.cut <- cut(tau)

	###  Experimental Samples
	for (i in 1:M) {
		##################################
		# Prior on log x                 #
		log10x.exp[i] ~ dunif(-12, -2)   #
		################################## 
		x.exp[i] <- pow(10, log10x.exp[i])
	}
	
	for (i in 1:M) {	
		emf.exp[i] ~ dnorm(mu.emf.exp[i], Tau.exp[i])
		mu.emf.exp[i] <- a.cut + b.cut *log(x.exp[i] + c.cut)/log(10)
		Tau.exp[i] <- tau.cut
		SD.exp[i] <- 1/sqrt(Tau.exp[i])				
	}
}