# ABC-SMC: recommendation how to choose epsilon

Thank you for your work in developing ABC algorithm in pymc3. I have been trying to understand it, and I have a small question: how to choose the value of epsilon?

I have noticed that the default value of 0.1 does not really work if I use another distance measure, for example, “sum_of_squared_distance”, instead of the default “absolute_error”.

I have been using another distance function which I called “deviance_distance”:

``````def deviance_distance(self, a, b):
return 2*np.sum(np.atleast_2d(np.multiply(a/len(a), np.log(np.divide(a, b)))))
``````

and I made it work for epsilon=1.0.

I have also another small question: `a` and `b` in distance function: a is the targetdata, b is the posterior. Am I correct?

ps: probably, @aloctavodia could help

Hi @aakhmetz,

Our ABC method use a (gaussian) pseudo-likelihood approach. We assume the distances are normally distributed with epsilon being the standard deviation of that normal distribution. This should give you an approximate idea or guess of which epsilon should be reasonable for your problem. Nevertheless, in general you may need to do more than one run with different values of epsilon.
You are right `a` is the observed data and `b` is the simulated data.

I will clarify all this on the doctrings. Thanks for your feedback.

1 Like

I see, thanks!

The main concern I have right now is that I can’t check whether the algorithm gives me the right posterior - at least the outcome looks quite sensitive to the choice of epsilon, or the threshold parameter