Duplicated parameter drawn from MCMC method.
library(EasyABC)
set.seed(1)
toy_model<-function(x){ 2 * x + 1 + rnorm(1) } # defining the model
toy_prior=list(c("unif",0,10)) # defining the prior distribution
sum_stat_obs=5 # defining the target summary statistics
tolerance=c(1,0.1,0.01) # defining the sequence of tolerance levels
n=100 # defining the number of sampled points in the posterior distribution
post2<-ABC_mcmc(method="Marjoram",model=toy_model,prior=toy_prior, summary_stat_target=sum_stat_obs,n_calibration=100, tolerance_quantile=0.1) # running ABC_mcmc
sum(duplicated(post2$param)) # Gives 8 duplicated parameters
post2$param[duplicated(post2$param)] # Gives values duplicated: 0.8995661 1.0522390 2.8312512 3.0472928 3.2670376 3.0458855 3.0458855 2.9037252
sort(post2$param) # print sorted values
The code incriminated is in ABC_MCMC method at line 2204.