Use Bayesian calibration to estimate parameters for y = a + b log(x + c) + error, where error follows a nomral distribution with mean 0 and standard deviation sigma. The limit of detection is also estimated.
describeISE(data, model.path=NA, model.name = NA, Z=NA, temperature = 21,
burnin=25000, iters = 50000, chains=4, thin = 1,
a.init= NA, b.init=NA, cstar.init=NA,
logc.limits = c(-8.9, -1.9), sigma.upper = 5, diagnostic.print=FALSE, offset = 1,
alpha = 0.05, beta = 0.05, SN = NA,
keep.coda=TRUE, coda.n=1000, program="OpenBUGS")
describeISE returns a list of class 'ISEdescription'. Individual components are:
Estimated value for a (from the median of the posterior distribution)
Estimated value for b (from the median of the posterior distribution)
Estimated value for c (from the median of the posterior distribution)
Estimated value for cstar (c to the 0.1 power) (from the median of the posterior distribution)
Estimated value for cstar (from the median of the posterior distribution)
List describing LOD method (alpha, beta or S/N) and corresponding values (alpha, beta, SN)
Estimated value for the limit of detection (from the median of the posterior distribution)
Lower limit for the above parameters (e.g. ahat.lcl, bhat.lcl, ...) (from the 2.5th percentile of the posterior distribution)
Upper limit for the above parameters (from the 95.5th percentile of the posterior distribution)
25th percentile estimated value of the limit of detection
75th percentile estimated value of the limit of detection
If keep.coda = TRUE, then these additional items are returned:
Random sample (without replacement) of length coda.n from the Markov Chain Monte Carlo simulations for a
Random sample (without replacement) of length coda.n from the Markov Chain Monte Carlo simulations for b
Random sample (without replacement) of length coda.n from the Markov Chain Monte Carlo simulations for c
Random sample (without replacement) of length coda.n from the Markov Chain Monte Carlo simulations for sigma
Random sample (without replacement) of length coda.n from the Markov Chain Monte Carlo simulations for cstar
Random sample (without replacement) of length coda.n from the Markov Chain Monte Carlo simulations for LOD
Calibration data (of class 'ISEdata'; see loadISEdata)
The directory where the BUGS model is located (defaults to 'models' sub-directory under the location of ISEtools package, e.g. '.../ISEtools/models')
The name of the BUGS model (e.g. 'Single_ISE_model.txt') (defaults are located in ISEtools package)
Ionic valence (e.g. for lead, Z = 2)
temperature in degrees C
Initial number of Monte Carlo simulations to discard.
Total number of iterations.
Number of parallel MCMC chains
Thinning rate, equal to 1/Proportion of simulations saved (e.g. thin = 10 records every tenth iteration).
Initial value for parameter a
Initial value for parameter b
Initial value for parameter cstar (c = cstar^10)
Upper and lower limits for log c initial values
Upper limit for initial value of sigma
logical flag indicating whether a diagnostic printout is desired (default is FALSE)
The initial value for the slope is based on the last data point as sorted by concentration (i.e. the Nth point) and the (N - offset) data point. The default is offset = 1, corresponding to the last and second to last data points.
False positive rate used for detection threshold (not output) to calculate LOD(alpha, beta) only returned if SN = NA
False negative rate used to calculate LOD(alpha, beta) only returned if SN = NA
Desired signal-to-noise ratio for LOD(S/N) calculations (default is to calculate the S/N equivalent based on alpha, beta)
Logical flag indicating whether the MCMC simulations should be returned (keep.coda = TRUE) or not (keep.coda = FALSE)
Indicates how many simulations to return (sampled with replacement). If coda.n >= the total, all are returned.
Choice of "OpenBUGS" (default and recommended for Windows or Linux) or "jags" (for macOS, see manual for warnings).
Peter Dillingham, peter.dillingham@otago.ac.nz
Dillingham, P.W., Radu, T., Diamond, D., Radu, A. and McGraw, C.M. (2012). Bayesian Methods for Ion Selective Electrodes. Electroanalysis, 24, 316-324.
Dillingham, P.W., Alsaedi, B.S.O. and McGraw, C.M. (2017). Characterising uncertainty in instrumental limits of detection when sensor response is non-linear. 2017 IEEE SENSORS, Glasgow, United Kingdom, pp. 1-3. <doi:10.1109/ICSENS.2017.8233898>
Dillingham, P.W., Alsaedi, B.S.O., Radu, A., and McGraw, C.M. (2019). Semi-automated data analysis for ion-selective electrodes and arrays using the R package ISEtools. Sensors 19(20), 4544. <doi: 10.3390/s19204544>
Dillingham, P.W., Alsaedi, B.S.O., Granados-Focil, S., Radu, A., and McGraw, C.M. (2020). Establishing meaningful Limits of Detection for ion-selective electrodes and other nonlinear sensors ACS Sensors, 5, 250-257. <doi:10.1021/acssensors.9b02133>
# Fast-running example with only 100 MCMC iterations for testing:
data(carbonate)
example3test = describeISE(carbonate, Z = -2, SN = 3.6,
burnin=100, iters=200, chains=1,
a.init= c(-50,180,140,65,100,170,100,130),
b.init=rep(-20,8), cstar.init=rep(0.2, 8), program="jags")
print(example3test)
summary(example3test)
plot(example3test)
# \donttest{
# Full example with 100,000 iterations (25,000 by 4 chains):
data(carbonate)
example3 = describeISE(carbonate, Z = -2, SN = 3.6)
print(example3)
summary(example3)
plot(example3)
# }
Run the code above in your browser using DataLab