You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I found a bug in the calculation of the euclidian distance in the script abc.R.
I detailed the error ( it’s very subtle but the impact is huge, at least for me) in the following R script.
I hope I’ve detailed the bug correctly.
target=iris[1,1:4]
sumstat=iris[-1,1:4]
### wrong way (used in abc package in abc.R script line 142)
wrong_diff = sumstat[,1] - target[1]
### correct way
correct_diff = sumstat[,1] - target[,1]
print(paste('the wrong way produce only',length(wrong_diff),' value'))
print(paste('the correct way produce',length(correct_diff),' values'))
## the wrong way is similar to write
test= sumstat[,1] - target[1,1]
print(test==wrong_diff)
## so actually, the gfit function calculate the godness of fit as the euclidian distance between the
## first element of the reference table and the target rather than the mean distance between the reference
## table and the target
The text was updated successfully, but these errors were encountered:
Hi,
I found a bug in the calculation of the euclidian distance in the script abc.R.
I detailed the error ( it’s very subtle but the impact is huge, at least for me) in the following R script.
I hope I’ve detailed the bug correctly.
The text was updated successfully, but these errors were encountered: