Repository navigation
[FIX] Add t_start to the first spike of StationaryPoissonProcess with refractory period - #734
Open
chenyangsu wants to merge 1 commit into
Conversation
… refractory period
Contributor
|
Hi @chenyangsu, Thanks for this fix, we'll take a look soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StationaryPoissonProcess(rate=20*pq.Hz, t_start=5000*pq.ms, t_stop=10000*pq.ms, refractory_period=3*pq.ms).generate_spiketrain()raisesValueError: The first spike (...) is before t_start (5000.0), and withas_array=Truethe spikes start near 0 ms. In_get_first_spike_equilibrium, the dead-time branch returns the latency withoutself._t_start, while the other two branches add it.The fix adds
self._t_startthere. The new test checks that 1000 first spikes fall aftert_start, with mean latency near the renewal-theory value E[ISI²]/(2 E[ISI]) = 47.1 ms. The unseededtest_t_start_and_t_stop(t_start=17 ms) failed in about 15% of runs on master for the same reason.Testing:
pytest elephant/test/test_spike_train_generation.py-> 59 passed. The new test fails on master.