# Loading datasets
data(simple)
head(simple)
###############################################
# Time delay estimation via Bayesian approach #
###############################################
output = bayesian(dat = simple, data.flux = FALSE, theta.ini = c(0, 0.03, 100),
delta.ini = 50, delta.uniform.range = c(0, 100),
delta.proposal.scale = 0.3,
tau.proposal.scale = 2, tau.prior.shape = 1, tau.prior.scale = 1,
sigma.prior.shape = 1, sigma.prior.scale = 2 * 10^(-7), asis = TRUE,
sample.size = 50, warmingup.size = 50)
names(output)
hist(output$delta, 50, xlab = expression(bold(Delta)),
main = expression(bold(paste("Histogram of posterior ", Delta))))
plot(output$delta, ylab = expression(bold(Delta)), xlab = "Iteration",
main = expression(bold(paste("Traceplot of posterior ", Delta))), type = "l")
acf(output$delta, main = expression(bold(paste("ACF of posterior ", Delta))))
### tempered transition
output = bayesian(dat = simple, data.flux = FALSE, theta.ini = c(0, 0.03, 100),
delta.ini = 50, delta.uniform.range = c(0, 100),
delta.proposal.scale = 5,
tau.proposal.scale = 2, tau.prior.shape = 1, tau.prior.scale = 1,
sigma.prior.shape = 1, sigma.prior.scale = 2 * 10^(-7), asis = TRUE,
sample.size = 50, warmingup.size = 50,
adaptive.delta = FALSE,
tempered.transition = TRUE, number.rungs = 2, temperature.base = 3)
# We recommend using 10 rungs with the base of the temperature equal to 3.
# We also recommend setting the "delta.proposal.scale" to
# the length of the feasible entire support / number of rungsRun the code above in your browser using DataLab