-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gfluct_new_exc.mod
232 lines (172 loc) · 5.57 KB
/
Gfluct_new_exc.mod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
TITLE Fluctuating conductances
COMMENT
-----------------------------------------------------------------------------
Fluctuating conductance model for synaptic bombardment
======================================================
THEORY
Synaptic bombardment is represented by a stochastic model containing
two fluctuating conductances g_e(t) and g_i(t) descibed by:
Isyn = g_e(t) * [V - E_e] + g_i(t) * [V - E_i]
d g_e / dt = -(g_e - g_e0) / tau_e + sqrt(D_e) * Ft
d g_i / dt = -(g_i - g_i0) / tau_i + sqrt(D_i) * Ft
where E_e, E_i are the reversal potentials, g_e0, g_i0 are the average
conductances, tau_e, tau_i are time constants, D_e, D_i are noise diffusion
coefficients and Ft is a gaussian white noise of unit standard deviation.
g_e and g_i are described by an Ornstein-Uhlenbeck (OU) stochastic process
where tau_e and tau_i represent the "correlation" (if tau_e and tau_i are
zero, g_e and g_i are white noise). The estimation of OU parameters can
be made from the power spectrum:
S(w) = 2 * D * tau^2 / (1 + w^2 * tau^2)
and the diffusion coeffient D is estimated from the variance:
D = 2 * sigma^2 / tau
NUMERICAL RESOLUTION
The numerical scheme for integration of OU processes takes advantage
of the fact that these processes are gaussian, which led to an exact
update rule independent of the time step dt (see Gillespie DT, Am J Phys
64: 225, 1996):
x(t+dt) = x(t) * exp(-dt/tau) + A * N(0,1)
where A = sqrt( D*tau/2 * (1-exp(-2*dt/tau)) ) and N(0,1) is a normal
random number (avg=0, sigma=1)
IMPLEMENTATION
This mechanism is implemented as a nonspecific current defined as a
point process.
PARAMETERS
The mechanism takes the following parameters:
E_e = 0 (mV) : reversal potential of excitatory conductance
E_i = -75 (mV) : reversal potential of inhibitory conductance
g_e0 = 0.0121 (umho) : average excitatory conductance
g_i0 = 0.0573 (umho) : average inhibitory conductance
std_e = 0.0030 (umho) : standard dev of excitatory conductance
std_i = 0.0066 (umho) : standard dev of inhibitory conductance
tau_e = 2.728 (ms) : time constant of excitatory conductance
tau_i = 10.49 (ms) : time constant of inhibitory conductance
Gfluct2: conductance cannot be negative
REFERENCE
Destexhe, A., Rudolph, M., Fellous, J-M. and Sejnowski, T.J.
Fluctuating synaptic conductances recreate in-vivo--like activity in
neocortical neurons. Neuroscience 107: 13-24 (2001).
(electronic copy available at http://cns.iaf.cnrs-gif.fr)
A. Destexhe, 1999
-----------------------------------------------------------------------------
ENDCOMMENT
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
NEURON {
POINT_PROCESS Gfluct2_exc
RANGE g_e, g_i, E_e, E_i, g_e0, g_i0, g_e1, g_i1
RANGE std_e, std_i, tau_e, tau_i, D_e, D_i
RANGE new_seed,i_exc
NONSPECIFIC_CURRENT i_exc
THREADSAFE
POINTER randObjPtr
}
UNITS {
(nA) = (nanoamp)
(mV) = (millivolt)
(umho) = (micromho)
}
PARAMETER {
dt (ms)
E_e = 0 (mV) : reversal potential of excitatory conductance
E_i = -75 (mV) : reversal potential of inhibitory conductance
g_e0 = 0.0121 (umho) : average excitatory conductance
g_i0 = 0.0573 (umho) : average inhibitory conductance
std_e = 0.0030 (umho) : standard dev of excitatory conductance
std_i = 0.0066 (umho) : standard dev of inhibitory conductance
tau_e = 2.728 (ms) : time constant of excitatory conductance
tau_i = 10.49 (ms) : time constant of inhibitory conductance
}
ASSIGNED {
noise
v (mV) : membrane voltage
i (nA) : fluctuating current
g_e (umho) : total excitatory conductance
g_i (umho) : total inhibitory conductance
g_e1 (umho) : fluctuating excitatory conductance
g_i1 (umho) : fluctuating inhibitory conductance
D_e (umho umho /ms) : excitatory diffusion coefficient
D_i (umho umho /ms) : inhibitory diffusion coefficient
exp_e
exp_i
amp_e (umho)
amp_i (umho)
randObjPtr
i_exc (nA)
i_inh (nA)
}
INITIAL {
g_e1 = 0
g_i1 = 0
if(tau_e != 0) {
D_e = 2 * std_e * std_e / tau_e
exp_e = exp(-dt/tau_e)
amp_e = std_e * sqrt( (1-exp(-2*dt/tau_e)) )
}
if(tau_i != 0) {
D_i = 2 * std_i * std_i / tau_i
exp_i = exp(-dt/tau_i)
amp_i = std_i * sqrt( (1-exp(-2*dt/tau_i)) )
}
}
BEFORE BREAKPOINT {
noise = randGen()
}
BREAKPOINT {
SOLVE oup
if(tau_e==0) {
g_e = std_e * noise
}
if(tau_i==0) {
g_i = std_i * noise
}
g_e = g_e0 + g_e1
if(g_e < 0) { g_e = 0 }
g_i = g_i0 + g_i1
if(g_i < 0) { g_i = 0 }
i_exc=g_e * (v - E_e)
:i_inh=g_i * (v - E_i)
:i = g_e * (v - E_e) + g_i * (v - E_i)
:i = i_exc + i_inh
}
PROCEDURE oup() { : use Scop function normrand(mean, std_dev)
if(tau_e!=0) {
g_e1 = exp_e * g_e1 + amp_e * noise
:printf("%g \n", g_e1)
}
if(tau_i!=0) {
g_i1 = exp_i * g_i1 + amp_i * noise
:printf("%g \n", g_i1)
}
}
VERBATIM
#ifndef NRN_VERSION_GTEQ_8_2_0
double nrn_random_pick(void* r);
void* nrn_random_arg(int argpos);
#define RANDCAST
#else
#define RANDCAST (Rand*)
#endif
ENDVERBATIM
FUNCTION randGen() {
VERBATIM
if (_p_randObjPtr) {
/*
:Supports separate independent but reproducible streams for
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.normal(0,1)
*/
_lrandGen = nrn_random_pick(RANDCAST _p_randObjPtr);
}else{
hoc_execerror("Random object ref not set correctly for randObjPtr"," only via hoc Random");
}
ENDVERBATIM
}
PROCEDURE setRandObj() {
VERBATIM
void** pv4 = (void**)(&_p_randObjPtr);
if (ifarg(1)) {
*pv4 = nrn_random_arg(1);
}else{
*pv4 = (void*)0;
}
ENDVERBATIM
}