Hello,
I would like to simulate a spike train during 2000ms. The rate of the Poisson process changes every millisecond. It is comprised between 20 spikes/second and 160 spikes/second.
I've tried the following simulation, using the inh_poisson_generator function:
import NeuroTools
import numpy as np
from NeuroTools import stgen
import matplotlib.pyplot as plt
import random
st_gen = stgen.StGen()
time = np.arange(0, 2000)
t_rate = []
for i in range (2000):
t_rate.append(random.randrange(20, 161, 1))
t_rate = np.array(t_rate)
Psim = st_gen.inh_poisson_generator(rate = t_rate, t = time, t_stop = 2000., array = True)
print Psim
The code, however, generally returns very few timestamps (e.g., array([ 1317.21345232, 1319.43234986, 1703.89908678]) ) which appears very weird to me. Am I doing things correctly?
Best,
Mathieu