- Timestamp:
- 09/02/10 15:48:38 (21 months ago)
- Files:
-
- 1 modified
-
trunk/src/stgen.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/stgen.py
r462 r463 257 257 def gamma_generator(self, a, b, t_start=0.0, t_stop=1000.0, array=False,debug=False): 258 258 """ 259 Returns a SpikeTrain whose spikes are a realization of a Poisson process 260 with the given rate (Hz) and stopping time t_stop (milliseconds). 259 Returns a SpikeTrain whose spikes are a realization of a gamma process 260 with the given shape a, b and stopping time t_stop (milliseconds). 261 (average rate will be a*b) 261 262 262 263 Note: t_start is always 0.0, thus all realizations are as if … … 271 272 272 273 Examples: 273 >> gen. poisson_generator(50, 0, 1000)274 >> gen. poisson_generator(20, 5000, 10000, array=True)274 >> gen.gamma_generator(10, 1/10., 0, 1000) 275 >> gen.gamma_generator(20, 1/5., 5000, 10000, array=True) 275 276 276 277 See also: … … 465 466 # find index in "t" time 466 467 t_i = numpy.searchsorted(t[t_i:],ps[i],'right')-1+t_i 467 if rn[i]<gamma_hazard _scipy((ps[i]-t_last)/1000.0,a[t_i],b[t_i])/rmax:468 if rn[i]<gamma_hazard((ps[i]-t_last)/1000.0,a[t_i],b[t_i])/rmax: 468 469 # keep spike 469 470 t_last = ps[i]
