Skip to content

Commit

Permalink
Add missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno committed Dec 6, 2022
1 parent 80fb1ea commit a2aebf8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion replay_trajectory_classification/standard_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from replay_trajectory_classification.core import scaled_likelihood
from replay_trajectory_classification.likelihoods.multiunit_likelihood import (
estimate_intensity,
poisson_mark_log_likelihood,
)
from scipy.signal import convolve
from scipy.special import cotdg
Expand All @@ -13,6 +12,25 @@
from sklearn.linear_model import LinearRegression


def poisson_mark_log_likelihood(
joint_mark_intensity, ground_process_intensity, time_bin_size=1
):
"""Probability of parameters given spiking indicator at a particular
time and associated marks.
Parameters
----------
joint_mark_intensity : ndarray, shape (n_time, n_bins)
ground_process_intensity : ndarray, shape (1, n_bins)
time_bin_size : int, optional
Returns
-------
poisson_mark_log_likelihood : ndarray, shape (n_time, n_bins)
"""
return np.log(joint_mark_intensity + np.spacing(1)) - (
(ground_process_intensity + np.spacing(1)) * time_bin_size
)


def predict_mark_likelihood(
start_time,
end_time,
Expand Down

0 comments on commit a2aebf8

Please sign in to comment.