def _compute_weighted_impulses_at_events_manual(self, data):
        # Compute the instantaneous rate at the individual events
        # Sum over potential parents.

        # TODO: Call cython function to evaluate instantaneous rate
        N, S, C, Z, dt_max = data.N, data.S, data.C, data.Z, self.model.dt_max
        W = self.W

        # Initialize matrix of weighted impulses from each process
        lmbda = np.zeros((self.K, N))
        for n in xrange(N):
            # First parent is just the background rate of this process
            # lmbda[self.K, n] += lambda0[C[n]]

            # Iterate backward from the most recent to compute probabilities of each parent spike
            for par in xrange(n-1, -1, -1):
                dt = S[n] - S[par]
                if dt == 0:
                    continue

                # Since the spikes are sorted, we can stop if we reach a potential
                # parent that occurred greater than dt_max in the past
                if dt >= dt_max:
                    break

                lmbda[C[par], n] += W[C[par], C[n]] * self.model.impulse_model.impulse(dt, C[par], C[n])

        return lmbda
dataset/ETHPy150Open slinderman/pyhawkes/pyhawkes/internals/weights.py/SpikeAndSlabContinuousTimeGammaWeights._compute_weighted_impulses_at_events_manual/original