Example #1
0
 def test_full_sigma_numpy(self):
     s = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
     simulator = GaussianMeanSimulator(self.D, s=s)
     true_sigma = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=float)
     self.assertTrue(np.array_equal(true_sigma, simulator.sigma))
     sim_data = simulator(self.theta, self.n_obs)
     self.assertTrue((sim_data.shape == self.n_sim, self.n_obs, self.D))
Example #2
0
 def test_isotropic_sigma(self):
     s = 2.5
     simulator = GaussianMeanSimulator(self.D, s=s)
     true_sigma = np.eye(self.D) * s
     self.assertTrue(np.array_equal(true_sigma, simulator.sigma))
     sim_data = simulator(self.theta, self.n_obs)
     self.assertTrue((sim_data.shape == self.n_sim, self.n_obs, self.D))
Example #3
0
 def test_diagonal_sigma_list_float(self):
     s = [1.0, 2.0, 3.0]
     simulator = GaussianMeanSimulator(self.D, s=s)
     true_sigma = np.array([[1, 0, 0], [0, 2, 0], [0, 0, 3]], dtype=float)
     self.assertTrue(np.array_equal(true_sigma, simulator.sigma))
     sim_data = simulator(self.theta, self.n_obs)
     self.assertTrue((sim_data.shape == self.n_sim, self.n_obs, self.D))
Example #4
0
 def test_unit_sigma(self):
     simulator = GaussianMeanSimulator(self.D)
     true_sigma = np.eye(self.D)
     self.assertTrue(np.array_equal(true_sigma, simulator.sigma))
     sim_data = simulator(self.theta, self.n_obs)
     self.assertTrue((sim_data.shape == self.n_sim, self.n_obs, self.D))