def test_spikes(self):
     trains = {}
     trains[0] = [neo.Spike(0 * pq.ms, waveform=[[-1, -2], [1, 2]] * pq.mV),
                  neo.Spike(0 * pq.ms, waveform=[[-1, -2], [1, 2]] * pq.mV)]
     trains[1] = trains[0]
     means = {}
     means[0] = neo.Spike(0 * pq.ms, waveform=[[-1, -1], [1, 1]] * pq.mV)
     exp = qa.variance_explained(trains, means)
     self.assertAlmostEqual(exp[1][0], 1)
     self.assertAlmostEqual(exp[1][0], 1)
     self.assertAlmostEqual(exp[0][0], 1)
     self.assertAlmostEqual(exp[0][1], 0.75)
 def test_trains(self):
     trains = {}
     trains[0] = neo.SpikeTrain(
         sp.zeros(2) * pq.ms, 0 * pq.ms,
         waveforms=[[[-1, -2], [1, 2]], [[-1, -2], [1, 2]]] * pq.mV)
     trains[1] = trains[0]
     means = {}
     means[1] = neo.Spike(0 * pq.ms, waveform=[[-1, -1], [1, 1]] * pq.mV)
     exp = qa.variance_explained(trains, means)
     self.assertAlmostEqual(exp[0][0], 1)
     self.assertAlmostEqual(exp[0][0], 1)
     self.assertAlmostEqual(exp[1][0], 1)
     self.assertAlmostEqual(exp[1][1], 0.75)
Beispiel #3
0
 def test_spikes(self):
     trains = {}
     trains[0] = [
         neo.Spike(0 * pq.ms, waveform=[[-1, -2], [1, 2]] * pq.mV),
         neo.Spike(0 * pq.ms, waveform=[[-1, -2], [1, 2]] * pq.mV)
     ]
     trains[1] = trains[0]
     means = {}
     means[0] = neo.Spike(0 * pq.ms, waveform=[[-1, -1], [1, 1]] * pq.mV)
     exp = qa.variance_explained(trains, means)
     self.assertAlmostEqual(exp[1][0], 1)
     self.assertAlmostEqual(exp[1][0], 1)
     self.assertAlmostEqual(exp[0][0], 1)
     self.assertAlmostEqual(exp[0][1], 0.75)
Beispiel #4
0
 def test_trains(self):
     trains = {}
     trains[0] = neo.SpikeTrain(
         sp.zeros(2) * pq.ms,
         0 * pq.ms,
         waveforms=[[[-1, -2], [1, 2]], [[-1, -2], [1, 2]]] * pq.mV)
     trains[1] = trains[0]
     means = {}
     means[1] = neo.Spike(0 * pq.ms, waveform=[[-1, -1], [1, 1]] * pq.mV)
     exp = qa.variance_explained(trains, means)
     self.assertAlmostEqual(exp[0][0], 1)
     self.assertAlmostEqual(exp[0][0], 1)
     self.assertAlmostEqual(exp[1][0], 1)
     self.assertAlmostEqual(exp[1][1], 0.75)