Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] cell assembly detection #576

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions elephant/cell_assembly_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,12 @@ def cell_assembly_detection(binned_spiketrain, max_lag, reference_lag=2,
# divide alpha by the number of tests performed in the first
# pairwise testing loop
number_test_performed = n_neurons * (n_neurons - 1) * (2 * max_lag + 1)
alpha = alpha * 2 / float(number_test_performed)
# Fix Issue #443
# keep alph as the original input for alpha, this was done following
# the MATLAB implementation by Eleonora Russo, see:
# https://github.com/DurstewitzLab/Cell-Assembly-Detection
alph = alpha
alpha = alph * 2 / float(number_test_performed)
if verbose:
print('actual significance_level', alpha)

Expand Down Expand Up @@ -363,7 +368,7 @@ def cell_assembly_detection(binned_spiketrain, max_lag, reference_lag=2,
if w2_to_test:

# bonferroni correction only for the tests actually performed
alpha = alpha / float(len(w2_to_test) * n_as * (2 * max_lag + 1))
alpha = alph / float(len(w2_to_test) * n_as * (2 * max_lag + 1))

# testing for the element in w2_to_test
for ww2 in range(len(w2_to_test)):
Expand Down