def compute_rate(self, S, C, T, dt=1.0):
        # TODO: Write a cythonized version of this
        # Compute rate for each process at intervals of dt
        t = np.concatenate([np.arange(0, T, step=dt), [T]])
        rate = np.zeros((t.size, self.K))
        for k in xrange(self.K):
            rate[:,k] += self.bias_model.lambda0[k]

            # Get the deltas between the time points and the spikes
            # Warning: this can be huge!
            deltas = t[:,None]-S[None,:]
            t_deltas, n_deltas = np.where((deltas>0) & (deltas < self.dt_max))
            N_deltas = t_deltas.size

            # Find the process the impulse came from
            senders = C[n_deltas]

            # Compute the impulse responses onto process k for each delta
            imps = self.impulse_model.impulse(deltas[t_deltas, n_deltas],
                                              senders,
                                              k
                                              )
            rate[t_deltas, k] += imps

        return rate, t
dataset/ETHPy150Open slinderman/pyhawkes/pyhawkes/models.py/ContinuousTimeNetworkHawkesModel.compute_rate/original