Skip to content

Commit

Permalink
re order rn generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jaehyukchoi committed May 17, 2022
1 parent 279310d commit b17c61c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyfeng/ousv.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,14 @@ def cond_states_step(self, vol_0, dt, zn=None):

if self.antithetic:
n_path_half = int(n_path//2)
z_sin = self.rng_spawn[2].standard_normal(size=(n_sin, n_path_half))
z_sin = self.rng_spawn[2].standard_normal(size=(n_path_half, n_sin)).T
z_sin = np.stack([z_sin, -z_sin], axis=2).reshape((n_sin, n_path))

z_gpqr = self.rng_spawn[1].standard_normal(size=(4, n_path_half))
z_gpqr = np.stack([z_gpqr, -z_gpqr], axis=2).reshape((4, n_path))
z_gpqr = self.rng_spawn[1].standard_normal(size=(n_path_half, 4)).T
z_gpqr = np.stack([z_gpqr, -z_gpqr], axis=-1).reshape((4, n_path))
else:
z_sin = self.rng_spawn[2].standard_normal(size=(n_sin, n_path))
z_gpqr = self.rng_spawn[1].standard_normal(size=(4, n_path))
z_sin = self.rng_spawn[2].standard_normal(size=(n_path, n_sin)).T
z_gpqr = self.rng_spawn[1].standard_normal(size=(n_path, 4)).T

z_g = z_gpqr[0, :]
z_p = z_gpqr[1, :]
Expand Down

0 comments on commit b17c61c

Please sign in to comment.