Exemplo n.º 1
0
 def test_with_correlated_data_multiple_replica(self):
     r"""Check the :class:`puwr.tauint` method with the
     :class:`puwr.correlated_data` method. Note that this is a
     statistical test with random numbers. We test for a
     :math:`3\sigma` deviation here, which is unlikely but not
     impossible. If this test fails, re-run a few times before
     making any conclusions."""
     fails = 0
     for known_tau in np.linspace(2,20,10):
         data = [[correlated_data(known_tau)[0][0],
                  correlated_data(known_tau)[0][0],
                  correlated_data(known_tau)[0][0]]]
         mean, err, tau, dtau = tauint(data, 0)
         if tau - 3*dtau > known_tau or \
             tau + 3*dtau < known_tau:
             print tau - known_tau, dtau
             fails += 1
     self.assertGreaterEqual(0, fails)
Exemplo n.º 2
0
 def test_with_correlated_data_multiple_replica(self):
     r"""Check the :class:`puwr.tauint` method with the
     :class:`puwr.correlated_data` method. Note that this is a
     statistical test with random numbers. We test for a
     :math:`3\sigma` deviation here, which is unlikely but not
     impossible. If this test fails, re-run a few times before
     making any conclusions."""
     fails = 0
     for known_tau in np.linspace(2, 20, 10):
         data = [[
             correlated_data(known_tau)[0][0],
             correlated_data(known_tau)[0][0],
             correlated_data(known_tau)[0][0]
         ]]
         mean, err, tau, dtau = tauint(data, 0)
         if tau - 3*dtau > known_tau or \
             tau + 3*dtau < known_tau:
             print tau - known_tau, dtau
             fails += 1
     self.assertGreaterEqual(0, fails)
Exemplo n.º 3
0
 def test_secondary_multiple_replica_product(self):
     """Test using the product of two observables."""
     fails = 0
     for known_tau in np.linspace(2,20,10):
         data = [[correlated_data(known_tau)[0][0],
                  correlated_data(known_tau)[0][0],
                  correlated_data(known_tau)[0][0]],
                 [correlated_data(known_tau)[0][0],
                  correlated_data(known_tau)[0][0],
                  correlated_data(known_tau)[0][0]]]
         mean, err, tau, dtau = tauint(data, lambda x, y: x * y)
         if tau - 3*dtau > known_tau or \
             tau + 3*dtau < known_tau:
             print tau - known_tau, dtau
             fails += 1
     self.assertGreaterEqual(0, fails)
Exemplo n.º 4
0
 def test_secondary_multiple_replica_product(self):
     """Test using the product of two observables."""
     fails = 0
     for known_tau in np.linspace(2, 20, 10):
         data = [[
             correlated_data(known_tau)[0][0],
             correlated_data(known_tau)[0][0],
             correlated_data(known_tau)[0][0]
         ],
                 [
                     correlated_data(known_tau)[0][0],
                     correlated_data(known_tau)[0][0],
                     correlated_data(known_tau)[0][0]
                 ]]
         mean, err, tau, dtau = tauint(data, lambda x, y: x * y)
         if tau - 3*dtau > known_tau or \
             tau + 3*dtau < known_tau:
             print tau - known_tau, dtau
             fails += 1
     self.assertGreaterEqual(0, fails)