BayesCal: BayesCal

BayesCalR Documentation

BayesCal

Description

De calculation using gibbs sampler (WinBUGS code call)

Usage

BayesCal(
  Sn,
  ph,
  n.chains = 1,
  n.iter = 2000,
  codaPkg = FALSE,
  n.thin = max(1, floor(n.chains * (n.iter - n.burnin)/1000)),
  n.burnin = n.iter/2,
  debug = FALSE,
  ...
)

Arguments

Sn

[list] (**required**) efficiencies S table (see Sn function)

ph

[numeric] (**required**): selected preheat

n.chains

[numeric] (**with default value**) number of Markov chains (default: 1)

n.iter

number of total iterations per chain (including burn in; default: 2000)

codaPkg

logical; if FALSE (default) a bugs object is returned, if TRUE file names of WinBUGS output are returned for easy access by the coda package through function read.bugs (not used if program="OpenBUGS"). A bugs object can be converted to an mcmc.list object as used by the coda package with the method as.mcmc.list (for which a method is provided by R2WinBUGS).

n.thin

thinning rate. Must be a positive integer. Set n.thin > 1 to save memory and computation time if n.iter is large. Default is max(1, floor(n.chains * (n.iter-n.burnin) / 1000)) which will only thin if there are at least 2000 simulations.

n.burnin

length of burn in, i.e. number of iterations to discard at the beginning. Default is n.iter/2, that is, discarding the first half of the simulations.

debug

if FALSE (default), WinBUGS is closed automatically when the script has finished running, otherwise WinBUGS remains open for further investigation

...

further arguments that will be passed to the function BayesCal

Value

WinBUGS simulation results (see R2WinBUGS::bugs help page)

Examples

data(Anatolian2, envir = environment())
file<-Anatolian2$FILE

## Not run: 
## You may need to edit "bugs.directory",
## also you need write access in the working directory:
BayesCal(Sn(file,ech=1,OSL=2,Dose=c(0,200,250,300,0,200)),ph=c(1,2,3,4),
         debug=TRUE)

## End(Not run)


Zink-Antoine/OSLpack documentation built on Feb. 23, 2025, 5:14 a.m.