if (FALSE) {
prior_gen <- function() {
return( rexp(n=2, rate=0.1) )
}
prior_dens <- function(val) {
return( dexp( val[1], rate = 0.1) * dexp( val[2], rate = 0.1) )
}
require(TESS)
treeSim <- function(params) {
t <- TESS.sim.age(n=1, lambda = params[1], mu = params[2], age = 10)[[1]]
return(t)
}
obs <- treeSim(c(0.5,0.1))
statWrapper <- function(tree1) {
return( nLTTstat_exact(tree1, obs, "abs"))
}
stats <- c(statWrapper)
results <- abc.smc.nltt(
obs, stats, treeSim, init_epsilon_values = 0.2,
prior_generating_function = prior_gen,
prior_density_function = prior_dens,
number_of_particles = 1000, sigma = 0.05, stop_rate = 1e-5
)
} # end of dontrun
Run the code above in your browser using DataLab