using Distributions, StochasticAD
v = [-1; 10]
function X(p)
u = rand(Bernoulli(p))
return v[u+1]
end
derivative_estimate(X,0.4) # this is 0.0
derivative_estimate(X,0.40) # this is 18.333333333333336
don't really understand why it is different, don't want to bother anyone, I'm just messing around
don't really understand why it is different, don't want to bother anyone, I'm just messing around