Closed pcjentsch closed 4 years ago
edited:
This issue can be worked around :) you can use this function in your code:
function ABCplan(prior,costfunction;params=())
fakedist(x,y)=x+y
ABCplan(prior, costfunction, 0.0, fakedist; params=params)
end
example:
prior = Normal(0,1)
sim(x,other) = abs(x-1.5) #it returns a distance value
plan=ABCplan(prior, sim)
@show mean(ABCDE(plan,0.01,verbose=false)[1])
# mean((ABCDE(plan, 0.01, verbose = false))[1]) = 1.4993631135745822
as soon as the whole code stabilizes, i will maybe incorporate a function similar to that one inside the package, for now i added a test to make sure i don't accidentally prevent a use of my package via distance values only :)
thank you!
Hi,
Thanks for the great package. Is it possible to create an interface that combines the
simulate
anddistance
functions into one function that is evaluating at inputs and returns real numbers? Is there a workaround I can use for this?My loss function is quite complex and separating the simulation from the distance, while possible, just makes my code more complex.
Before the most recent patch, I was able to work around this as the distance always used the second argument for
tdata
, but that seems to have changed.Thanks!