Add option to use equiprobable univariate grids
@@ -360,7 +360,7 @@ class MVNormal(Distribution):
return draws
- def approx(self, N):
+ def approx(self, N, equiprobable = False):
"""
Returns a discrete approximation of this distribution.
@@ -383,7 +383,10 @@ class MVNormal(Distribution):
A = np.matmul(Q,sqrtV)
# Now find a discretization for a univariate standard normal.
+ if equiprobable:
z_approx = Normal().approx_equiprobable(N)
+ else:
+ z_approx = Normal().approx(N)
# Now create the multivariate grid and pmf
Z = np.array(list(product(*[z_approx.X]*self.M)))
