1
0
Fork 0

understanding importance sampling

This commit is contained in:
Alejandro Moreo Fernandez 2023-11-21 10:26:13 +01:00
parent 61399d66f6
commit ac88dc8961
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ def montecarlo_classweight(p, q, f=hd2, trials=TRIALS, epsilon=EPS):
qs = q.pdf(xs)+epsilon
N = trials
n = q.n
return (1/(N*n))*np.sum(weights*f(ps/qs))
return (1/(N))*np.sum(weights*f(ps/qs))
class Q: