sim.lif {pro} | R Documentation |
Simulate various kinds of neural measures (e.g. membrane potentials and spikes) from a LIF neuron.
sim.lif(n, I, C, R, Vth = 1, V0 = 0, bin = 5, dt = 0.05)
n |
Number of time bins. The total time is |
I |
Input stimulus vector of length |
C |
Membrane capacitance of the simulated neuron. |
R |
Membrane resistance of the simulated neuron. |
Vth |
Membrane potential threshold for spiking. |
V0 |
Membrane potential reset value after spiking. |
bin |
Time length for each time bin. Default 5 millisecond. |
dt |
Time length for each simulation step. Default 0.05 millisecond. |
a list
of simulated neural spikes, optogenetic light flashes, and simulation parameters.
n<- 500
set.seed(100)
re <- sim.lif(n, rbinom(n, 1, 0.14), 7, 3)