Slice_Cycle: Slice_Cycle

View source: R/Slice_Cycle.R

Slice_CycleR Documentation

Slice_Cycle

Description

Monte-Carlo procedure for multiple curves

Usage

Slice_Cycle(x, y, n_iter = 1000, n_burnin = n_iter/2)

Arguments

x

numeric (required) a variable

y

numeric (required) the measured value for x

n_iter

numeric (with default value) number of total iterations (including burn in; default: 1000)

n_burnin

numeric (with default) 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.

Value

a list with the following elements

Element Type Description
⁠$x1⁠ numeric the new point
⁠$L⁠ numeric the new left boundary of the slice
⁠$R⁠ numeric the new right boundary of the slice
⁠$iter⁠ numeric the number of iteration

Examples

#multiples TL calculated with RLumModel##########
#call function "model_LuminescenceSignals", model = "Bailey2001"
# the irradiation dose is varied and then compared.
require(RLumModel)
irradiation_dose <- seq(from = 0,to = 100,by = 20)
model.output <- lapply(irradiation_dose,
      function(x){
           sequence <- list(IRR = c(20, x, 1),
              #PH = c(220, 10, 5),
              TL=c(20,400,5))
           data <- model_LuminescenceSignals(
              sequence = sequence,
              model = "Bailey2001",
              plot = FALSE,
              verbose = FALSE)
           return(get_RLum(data, recordType = "TL$", drop = FALSE))
})
##combine output curves
TL_curve.merged <- merge_RLum(model.output)
##plot
plot_RLum(
 object = TL_curve.merged,
 xlab = "Temperature [°C]",
 ylab = "TL signal [a.u.]",
 main = "TL signal with various dose",
 legend.text = paste("dose", irradiation_dose, "Gy"),
 combine = TRUE)
##
n.pt<-length(TL_curve.merged[1]$data[,1])
n.irr<-length(irradiation_dose)
y<-x<-array(dim=c(n.pt,n.irr))
for (i in 1:n.irr){
 x[,i]<-TL_curve.merged[i]$data[,1]
 y[,i]<-TL_curve.merged[i]$data[,2]
}


if (dev.cur()!=1) dev.off()
Slice_mc(x,y,n_iter=1000,n_burnin=500)



Zink-Antoine/Slice_sampler documentation built on Feb. 27, 2025, 9:23 p.m.