diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 548a0bd..04a37dc 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2025-01-06T18:37:19","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2025-01-07T15:39:24","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index a3833a3..0e7ba0b 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,6 +1,6 @@ -API · Neuroblox

API Documentation

Neuroblox.BalloonModelType

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • lnκ: logarithmic prefactor to signal decay H[1], set to 0 for standard parameter value.
  • lnτ: logarithmic prefactor to transit time H[3], set to 0 for standard parameter value.
  • lnϵ: logarithm of ratio of intra- to extra-vascular signal

NB: the prefix ln of the variables u, ν, q as well as the parameters κ, τ denotes their transformation into logarithmic space to enforce their positivity. This transformation is considered in the derivates of the model equations below.

Citations:

  1. Stephan K E, Weiskopf N, Drysdale P M, Robinson P A, and Friston K J. Comparing Hemodynamic Models with DCM. NeuroImage 38, no. 3 (2007): 387–401. doi: 10.1016/j.neuroimage.2007.07.040
  2. Hofmann D, Chesebro A G, Rackauckas C, Mujica-Parodi L R, Friston K J, Edelman A, and Strey H H. Leveraging Julia's Automated Differentiation and Symbolic Computation to Increase Spectral DCM Flexibility and Speed, 2023. doi: 10.1101/2023.10.27.564407
source
Neuroblox.DBSMethod
DBS(; name, namespace=nothing, frequency=130.0, amplitude=2.5, pulse_width=0.066, 
-    offset=0.0, start_time=0.0, smooth=1e-4)

Create a continuous deep brain stimulation (DBS) stimulus with regular pulses.

Arguments:

  • name: Name given to ODESystem object within the blox
  • namespace: Additional namespace above name if needed for inheritance
  • frequency: Pulse frequency in Hz
  • amplitude: Pulse amplitude in arbitrary units
  • pulse_width: Duration of each pulse in ms
  • offset: Baseline value of the signal between pulses
  • start_time: Time delay before stimulation begins in ms
  • smooth: Smoothing parameter for pulse transitions, set to 0 for sharp transitions

Returns a DBS stimulus blox that outputs square pulses with specified parameters.

source
Neuroblox.Generic2dOscillatorType
Generic2dOscillator(name, namespace, ...)
+API · Neuroblox

API Documentation

Neuroblox.BalloonModelType

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • lnκ: logarithmic prefactor to signal decay H[1], set to 0 for standard parameter value.
  • lnτ: logarithmic prefactor to transit time H[3], set to 0 for standard parameter value.
  • lnϵ: logarithm of ratio of intra- to extra-vascular signal

NB: the prefix ln of the variables u, ν, q as well as the parameters κ, τ denotes their transformation into logarithmic space to enforce their positivity. This transformation is considered in the derivates of the model equations below.

Citations:

  1. Stephan K E, Weiskopf N, Drysdale P M, Robinson P A, and Friston K J. Comparing Hemodynamic Models with DCM. NeuroImage 38, no. 3 (2007): 387–401. doi: 10.1016/j.neuroimage.2007.07.040
  2. Hofmann D, Chesebro A G, Rackauckas C, Mujica-Parodi L R, Friston K J, Edelman A, and Strey H H. Leveraging Julia's Automated Differentiation and Symbolic Computation to Increase Spectral DCM Flexibility and Speed, 2023. doi: 10.1101/2023.10.27.564407
source
Neuroblox.DBSMethod
DBS(; name, namespace=nothing, frequency=130.0, amplitude=2.5, pulse_width=0.066, 
+    offset=0.0, start_time=0.0, smooth=1e-4)

Create a continuous deep brain stimulation (DBS) stimulus with regular pulses.

Arguments:

  • name: Name given to ODESystem object within the blox
  • namespace: Additional namespace above name if needed for inheritance
  • frequency: Pulse frequency in Hz
  • amplitude: Pulse amplitude in arbitrary units
  • pulse_width: Duration of each pulse in ms
  • offset: Baseline value of the signal between pulses
  • start_time: Time delay before stimulation begins in ms
  • smooth: Smoothing parameter for pulse transitions, set to 0 for sharp transitions

Returns a DBS stimulus blox that outputs square pulses with specified parameters.

source
Neuroblox.Generic2dOscillatorType
Generic2dOscillator(name, namespace, ...)
 
 The Generic2dOscillator model is a generic dynamic system with two state
 variables. The dynamic equations of this model are composed of two ordinary
@@ -17,15 +17,15 @@
         \dot{V} &= d \, \tau (-f V^3 + e V^2 + g V + \alpha W + \gamma I) \\
         \dot{W} &= \dfrac{d}{	au}\,\,(c V^2 + b V - \beta W + a)
         \end{align}
-```

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Other parameters: See reference for full list. Note that parameters are scaled so that units of time are in milliseconds.

Citations: FitzHugh, R., Impulses and physiological states in theoretical models of nerve membrane, Biophysical Journal 1: 445, 1961.

Nagumo et.al, An Active Pulse Transmission Line Simulating Nerve Axon, Proceedings of the IRE 50: 2061, 1962.

Stefanescu, R., Jirsa, V.K. Reduced representations of heterogeneous mixed neural networks with synaptic coupling. Physical Review E, 83, 2011.

Jirsa VK, Stefanescu R. Neural population modes capture biologically realistic large-scale network dynamics. Bulletin of Mathematical Biology, 2010.

Stefanescu, R., Jirsa, V.K. A low dimensional description of globally coupled heterogeneous neural networks of excitatory and inhibitory neurons. PLoS Computational Biology, 4(11), 2008).

source
Neuroblox.HarmonicOscillatorType
HarmonicOscillator(name, namespace, ω, ζ, k, h)
+```

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Other parameters: See reference for full list. Note that parameters are scaled so that units of time are in milliseconds.

Citations: FitzHugh, R., Impulses and physiological states in theoretical models of nerve membrane, Biophysical Journal 1: 445, 1961.

Nagumo et.al, An Active Pulse Transmission Line Simulating Nerve Axon, Proceedings of the IRE 50: 2061, 1962.

Stefanescu, R., Jirsa, V.K. Reduced representations of heterogeneous mixed neural networks with synaptic coupling. Physical Review E, 83, 2011.

Jirsa VK, Stefanescu R. Neural population modes capture biologically realistic large-scale network dynamics. Bulletin of Mathematical Biology, 2010.

Stefanescu, R., Jirsa, V.K. A low dimensional description of globally coupled heterogeneous neural networks of excitatory and inhibitory neurons. PLoS Computational Biology, 4(11), 2008).

source
Neuroblox.HarmonicOscillatorType
HarmonicOscillator(name, namespace, ω, ζ, k, h)
 
 Create a harmonic oscillator blox with the specified parameters.
 The formal definition of this blox is:

\[\frac{dx}{dt} = y-(2*\omega*\zeta*x)+ k*(2/\pi)*(atan((\sum{jcn})/h) -\frac{dy}{dt} = -(\omega^2)*x\]

where ``jcn`` is any input to the blox.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • ω: Base frequency. Note the default value is scaled to give oscillations in milliseconds to match other blocks.
  • ζ: Damping ratio.
  • k: Gain.
  • h: Threshold.
source
Neuroblox.JansenRitType
JansenRit(name, namespace, τ, H, λ, r, cortical, delayed)
+\frac{dy}{dt} = -(\omega^2)*x\]

where ``jcn`` is any input to the blox.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • ω: Base frequency. Note the default value is scaled to give oscillations in milliseconds to match other blocks.
  • ζ: Damping ratio.
  • k: Gain.
  • h: Threshold.
source
Neuroblox.JansenRitType
JansenRit(name, namespace, τ, H, λ, r, cortical, delayed)
 
 Create a Jansen Rit blox as described in Liu et al.
 The formal definition of this blox is:

\[\frac{dx}{dt} = y-\frac{2}{\tau}x -\frac{dy}{dt} = -\frac{x}{\tau^2} + \frac{H}{\tau} [\frac{2\lambda}{1+\text{exp}(-r*\sum{jcn})} - \lambda]\]

where $jcn$ is any input to the blox.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • τ: Time constant. Defaults to 1 for cortical regions, 14 for subcortical.
  • H: See equation for use. Defaults to 0.02 for both cortical and subcortical regions.
  • λ: See equation for use. Defaults to 5 for cortical regions, 400 for subcortical.
  • r: See equation for use. Defaults to 0.15 for cortical regions, 0.1 for subcortical.
  • cortical: Boolean to determine whether to use cortical or subcortical parameters. Specifying any of the parameters above will override this.
  • delayed: Boolean to indicate whether states are delayed

Citations:

  1. Liu C, Zhou C, Wang J, Fietkiewicz C, Loparo KA. The role of coupling connections in a model of the cortico-basal ganglia-thalamocortical neural loop for the generation of beta oscillations. Neural Netw. 2020 Mar;123:381-392. doi: 10.1016/j.neunet.2019.12.021.
source
Neuroblox.KuramotoOscillatorType
KuramotoOscillator(name, namespace, ...)
+\frac{dy}{dt} = -\frac{x}{\tau^2} + \frac{H}{\tau} [\frac{2\lambda}{1+\text{exp}(-r*\sum{jcn})} - \lambda]\]

where $jcn$ is any input to the blox.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • τ: Time constant. Defaults to 1 for cortical regions, 14 for subcortical.
  • H: See equation for use. Defaults to 0.02 for both cortical and subcortical regions.
  • λ: See equation for use. Defaults to 5 for cortical regions, 400 for subcortical.
  • r: See equation for use. Defaults to 0.15 for cortical regions, 0.1 for subcortical.
  • cortical: Boolean to determine whether to use cortical or subcortical parameters. Specifying any of the parameters above will override this.
  • delayed: Boolean to indicate whether states are delayed

Citations:

  1. Liu C, Zhou C, Wang J, Fietkiewicz C, Loparo KA. The role of coupling connections in a model of the cortico-basal ganglia-thalamocortical neural loop for the generation of beta oscillations. Neural Netw. 2020 Mar;123:381-392. doi: 10.1016/j.neunet.2019.12.021.
source
Neuroblox.KuramotoOscillatorType
KuramotoOscillator(name, namespace, ...)
 
 Simple implementation of the Kuramoto oscillator as described in the original paper [1].
 Useful for general models of synchronization and oscillatory behavior.
@@ -47,29 +47,29 @@
         \end{equation}
 ```
 
-where $W_i$ is a Wiener process and $\zeta_i$ is the noise strength.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Other parameters: See reference for full list. Note that parameters are scaled so that units of time are in milliseconds. Default parameter values are taken from [2].

Citations:

  1. Kuramoto, Y. (1975). Self-entrainment of a population of coupled non-linear oscillators. In: Araki, H. (eds) International Symposium on Mathematical Problems in Theoretical Physics. Lecture Notes in Physics, vol 39. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0013365

  2. Sermon JJ, Wiest C, Tan H, Denison T, Duchet B. Evoked resonant neural activity long-term dynamics can be reproduced by a computational model with vesicle depletion. Neurobiol Dis. 2024 Jun 14;199:106565. doi: 10.1016/j.nbd.2024.106565. Epub ahead of print. PMID: 38880431.

source
Neuroblox.LarterBreakspearType
LarterBreakspear(name, namespace, ...)
+where $W_i$ is a Wiener process and $\zeta_i$ is the noise strength.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Other parameters: See reference for full list. Note that parameters are scaled so that units of time are in milliseconds. Default parameter values are taken from [2].

Citations:

  1. Kuramoto, Y. (1975). Self-entrainment of a population of coupled non-linear oscillators. In: Araki, H. (eds) International Symposium on Mathematical Problems in Theoretical Physics. Lecture Notes in Physics, vol 39. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0013365

  2. Sermon JJ, Wiest C, Tan H, Denison T, Duchet B. Evoked resonant neural activity long-term dynamics can be reproduced by a computational model with vesicle depletion. Neurobiol Dis. 2024 Jun 14;199:106565. doi: 10.1016/j.nbd.2024.106565. Epub ahead of print. PMID: 38880431.

source
Neuroblox.LarterBreakspearType
LarterBreakspear(name, namespace, ...)
 
 Create a Larter Breakspear blox described in Endo et al. For a full list of the parameters used see the reference.
-If you need to modify the parameters, see Chesebro et al. and van Nieuwenhuizen et al. for physiological ranges.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Other parameters: See reference for full list. Note that parameters are scaled so that units of time are in milliseconds.

Citations:

  1. Endo H, Hiroe N, Yamashita O. Evaluation of Resting Spatio-Temporal Dynamics of a Neural Mass Model Using Resting fMRI Connectivity and EEG Microstates. Front Comput Neurosci. 2020 Jan 17;13:91. doi: 10.3389/fncom.2019.00091.
  2. Chesebro AG, Mujica-Parodi LR, Weistuch C. Ion gradient-driven bifurcations of a multi-scale neuronal model. Chaos Solitons Fractals. 2023 Feb;167:113120. doi: 10.1016/j.chaos.2023.113120.
  3. van Nieuwenhuizen, H, Chesebro, AG, Polis, C, Clarke, K, Strey, HH, Weistuch, C, Mujica-Parodi, LR. Ketosis regulates K+ ion channels, strengthening brain-wide signaling disrupted by age. Preprint. bioRxiv 2023.05.10.540257; doi: https://doi.org/10.1101/2023.05.10.540257.
source
Neuroblox.OUBloxType

Ornstein-Uhlenbeck process Blox

variables: x(t): value jcn: input parameters: τ: relaxation time μ: average value σ: random noise (variance of OU process is τ*σ^2/2) returns: an ODE System (but with brownian parameters)

source
Neuroblox.PINGNeuronExciType
PINGNeuronExci(name, namespace, C, g_Na, V_Na, g_K, V_K, g_L, V_L, I_ext, τ_R, τ_D)
+If you need to modify the parameters, see Chesebro et al. and van Nieuwenhuizen et al. for physiological ranges.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Other parameters: See reference for full list. Note that parameters are scaled so that units of time are in milliseconds.

Citations:

  1. Endo H, Hiroe N, Yamashita O. Evaluation of Resting Spatio-Temporal Dynamics of a Neural Mass Model Using Resting fMRI Connectivity and EEG Microstates. Front Comput Neurosci. 2020 Jan 17;13:91. doi: 10.3389/fncom.2019.00091.
  2. Chesebro AG, Mujica-Parodi LR, Weistuch C. Ion gradient-driven bifurcations of a multi-scale neuronal model. Chaos Solitons Fractals. 2023 Feb;167:113120. doi: 10.1016/j.chaos.2023.113120.
  3. van Nieuwenhuizen, H, Chesebro, AG, Polis, C, Clarke, K, Strey, HH, Weistuch, C, Mujica-Parodi, LR. Ketosis regulates K+ ion channels, strengthening brain-wide signaling disrupted by age. Preprint. bioRxiv 2023.05.10.540257; doi: https://doi.org/10.1101/2023.05.10.540257.
source
Neuroblox.OUBloxType

Ornstein-Uhlenbeck process Blox

variables: x(t): value jcn: input parameters: τ: relaxation time μ: average value σ: random noise (variance of OU process is τ*σ^2/2) returns: an ODE System (but with brownian parameters)

source
Neuroblox.PINGNeuronExciType
PINGNeuronExci(name, namespace, C, g_Na, V_Na, g_K, V_K, g_L, V_L, I_ext, τ_R, τ_D)
 
 Create an excitatory neuron from Borgers et al. (2008).
 The formal definition of this blox is:

\[\frac{dV}{dt} = \frac{1}{C}(-g_{Na}*m_{\infty}^3*h*(V - V_{Na}) - g_K*n^4*(V - V_K) - g_L*(V - V_L) + I_{ext} + jcn) \m_{\infty} = \frac{a_m(V)}{a_m(V) + b_m(V)} \frac{dn}{dt} = a_n(V)*(1 - n) - b_n(V)*n \frac{dh}{dt} = a_h(V)*(1 - h) - b_h(V)*h -\frac{ds}{dt} = \frac{1}{2}*(1 + \tanh(V/10))*(\frac{1 - s}{\tau_R} - \frac{s}{\tau_D})\]

where $jcn$ is any input to the blox. Note that this is a modified Hodgkin-Huxley formalism with an additional synaptic accumulation term. Synapses are added into the $jcn$ term by connecting the postsynaptic neuron's voltage to the presynaptic neuron's output:

\[jcn = w*s*(V_E - V)\]

where $w$ is the weight of the synapse and $V_E$ is the reversal potential of the excitatory synapse.

Inputs:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • C: Membrane capacitance (defaults to 1.0).
  • g_Na: Sodium conductance (defaults to 100.0).
  • V_Na: Sodium reversal potential (defaults to 50.0).
  • g_K: Potassium conductance (defaults to 80.0).
  • V_K: Potassium reversal potential (defaults to -100.0).
  • g_L: Leak conductance (defaults to 0.1).
  • V_L: Leak reversal potential (defaults to -67.0).
  • I_ext: External current (defaults to 0.0).
  • τ_R: Rise time of synaptic conductance (defaults to 0.2).
  • τ_D: Decay time of synaptic conductance (defaults to 2.0).
source
Neuroblox.PINGNeuronInhibType
PINGNeuronInhib(name, namespace, C, g_Na, V_Na, g_K, V_K, g_L, V_L, I_ext, τ_R, τ_D)
+\frac{ds}{dt} = \frac{1}{2}*(1 + \tanh(V/10))*(\frac{1 - s}{\tau_R} - \frac{s}{\tau_D})\]

where $jcn$ is any input to the blox. Note that this is a modified Hodgkin-Huxley formalism with an additional synaptic accumulation term. Synapses are added into the $jcn$ term by connecting the postsynaptic neuron's voltage to the presynaptic neuron's output:

\[jcn = w*s*(V_E - V)\]

where $w$ is the weight of the synapse and $V_E$ is the reversal potential of the excitatory synapse.

Inputs:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • C: Membrane capacitance (defaults to 1.0).
  • g_Na: Sodium conductance (defaults to 100.0).
  • V_Na: Sodium reversal potential (defaults to 50.0).
  • g_K: Potassium conductance (defaults to 80.0).
  • V_K: Potassium reversal potential (defaults to -100.0).
  • g_L: Leak conductance (defaults to 0.1).
  • V_L: Leak reversal potential (defaults to -67.0).
  • I_ext: External current (defaults to 0.0).
  • τ_R: Rise time of synaptic conductance (defaults to 0.2).
  • τ_D: Decay time of synaptic conductance (defaults to 2.0).
source
Neuroblox.PINGNeuronInhibType
PINGNeuronInhib(name, namespace, C, g_Na, V_Na, g_K, V_K, g_L, V_L, I_ext, τ_R, τ_D)
 
 Create an inhibitory neuron from Borgers et al. (2008).
 The formal definition of this blox is:

\[\frac{dV}{dt} = \frac{1}{C}(-g_{Na}*m_{\infty}^3*h*(V - V_{Na}) - g_K*n^4*(V - V_K) - g_L*(V - V_L) + I_{ext} + jcn) \m_{\infty} = \frac{a_m(V)}{a_m(V) + b_m(V)} \frac{dn}{dt} = a_n(V)*(1 - n) - b_n(V)*n \frac{dh}{dt} = a_h(V)*(1 - h) - b_h(V)*h -\frac{ds}{dt} = \frac{1}{2}*(1 + \tanh(V/10))*(\frac{1 - s}{\tau_R} - \frac{s}{\tau_D})\]

where $jcn$ is any input to the blox. Note that this is a modified Hodgkin-Huxley formalism with an additional synaptic accumulation term. Synapses are added into the $jcn$ term by connecting the postsynaptic neuron's voltage to the presynaptic neuron's output:

\[jcn = w*s*(V_I - V)\]

where $w$ is the weight of the synapse and $V_I$ is the reversal potential of the inhibitory synapse.

Inputs:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • C: Membrane capacitance (defaults to 1.0).
  • g_Na: Sodium conductance (defaults to 35.0).
  • V_Na: Sodium reversal potential (defaults to 55.0).
  • g_K: Potassium conductance (defaults to 9.0).
  • V_K: Potassium reversal potential (defaults to -90.0).
  • g_L: Leak conductance (defaults to 0.1).
  • V_L: Leak reversal potential (defaults to -65.0).
  • I_ext: External current (defaults to 0.0).
  • τ_R: Rise time of synaptic conductance (defaults to 0.5).
  • τ_D: Decay time of synaptic conductance (defaults to 10.0).
source
Neuroblox.WilsonCowanType
WilsonCowan(name, namespace, τ_E, τ_I, a_E, a_I, c_EE, c_IE, c_EI, c_II, θ_E, θ_I, η)
+\frac{ds}{dt} = \frac{1}{2}*(1 + \tanh(V/10))*(\frac{1 - s}{\tau_R} - \frac{s}{\tau_D})\]

where $jcn$ is any input to the blox. Note that this is a modified Hodgkin-Huxley formalism with an additional synaptic accumulation term. Synapses are added into the $jcn$ term by connecting the postsynaptic neuron's voltage to the presynaptic neuron's output:

\[jcn = w*s*(V_I - V)\]

where $w$ is the weight of the synapse and $V_I$ is the reversal potential of the inhibitory synapse.

Inputs:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • C: Membrane capacitance (defaults to 1.0).
  • g_Na: Sodium conductance (defaults to 35.0).
  • V_Na: Sodium reversal potential (defaults to 55.0).
  • g_K: Potassium conductance (defaults to 9.0).
  • V_K: Potassium reversal potential (defaults to -90.0).
  • g_L: Leak conductance (defaults to 0.1).
  • V_L: Leak reversal potential (defaults to -65.0).
  • I_ext: External current (defaults to 0.0).
  • τ_R: Rise time of synaptic conductance (defaults to 0.5).
  • τ_D: Decay time of synaptic conductance (defaults to 10.0).
source
Neuroblox.WilsonCowanType
WilsonCowan(name, namespace, τ_E, τ_I, a_E, a_I, c_EE, c_IE, c_EI, c_II, θ_E, θ_I, η)
 
 Create a standard Wilson Cowan blox.
 The formal definition of this blox is:

\[\frac{dE}{dt} = \frac{-E}{\tau_E} + \frac{1}{1 + \text{exp}(-a_E*(c_{EE}*E - c_{IE}*I - \theta_E + \eta*(\sum{jcn}))} -\frac{dI}{dt} = \frac{-I}{\tau_I} + \frac{1}{1 + exp(-a_I*(c_{EI}*E - c_{II}*I - \theta_I)}\]

where $jcn$ is any input to the blox.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Others: See equation for use.
source
Neuroblox.WinnerTakeAllBloxType
WinnerTakeAllBlox

Creates a winner-take-all local circuit found in neocortex, typically 5 pyramidal (excitatory) neurons send synapses to a single interneuron (inhibitory) and receive feedback inhibition from that interneuron.

source
LinearAlgebra.eigenMethod
function LinearAlgebra.eigen(M::Matrix{Dual{T, P, np}}) where {T, P, np}
+\frac{dI}{dt} = \frac{-I}{\tau_I} + \frac{1}{1 + exp(-a_I*(c_{EI}*E - c_{II}*I - \theta_I)}\]

where $jcn$ is any input to the blox.

Arguments:

  • name: Name given to ODESystem object within the blox.
  • namespace: Additional namespace above name if needed for inheritance.
  • Others: See equation for use.
source
Neuroblox.WinnerTakeAllBloxType
WinnerTakeAllBlox

Creates a winner-take-all local circuit found in neocortex, typically 5 pyramidal (excitatory) neurons send synapses to a single interneuron (inhibitory) and receive feedback inhibition from that interneuron.

source
LinearAlgebra.eigenMethod
function LinearAlgebra.eigen(M::Matrix{Dual{T, P, np}}) where {T, P, np}
 
 Dispatch of LinearAlgebra.eigen for dual matrices with complex numbers. Make the eigenvalue decomposition 
 amenable to automatic differentiation. To do so compute the analytical derivative of eigenvalues
@@ -79,10 +79,10 @@
 - `M`: matrix of type Dual of which to compute the eigenvalue decomposition. 
 
 Returns:
-- `Eigen(evals, evecs)`: eigenvalue decomposition returned as type LinearAlgebra.Eigen
source
Neuroblox.ARVTargetMethod

ARVTarget Time series data is bandpass filtered and then the power spectrum is computed for a given time interval (control bin), returned as the average value of the power spectral density within a certain frequency band ([lb, ub]).

source
Neuroblox.CDVTargetMethod

CDVTarget Time series data is bandpass filtered and hilbert-transformed. Phase angle is computed in radians. Circular difference is quantified as the angle of circular_location.

source
Neuroblox.PDVTargetMethod

PDVTarget Time series data is bandpass filtered and hilbert-transformed. Phase angle is computed in radians. Phase deviation is quantified as the angle difference between a given set of signals.

source
Neuroblox.PLVTargetMethod

PLVTarget Time series data is bandpass filtered and hilbert-transformed. Phase angle is computed in radians.

source
Neuroblox.ProtocolDBSMethod
ProtocolDBS(; name, namespace=nothing, frequency=130.0, amplitude=2.5,
+- `Eigen(evals, evecs)`: eigenvalue decomposition returned as type LinearAlgebra.Eigen
source
Neuroblox.ARVTargetMethod

ARVTarget Time series data is bandpass filtered and then the power spectrum is computed for a given time interval (control bin), returned as the average value of the power spectral density within a certain frequency band ([lb, ub]).

source
Neuroblox.CDVTargetMethod

CDVTarget Time series data is bandpass filtered and hilbert-transformed. Phase angle is computed in radians. Circular difference is quantified as the angle of circular_location.

source
Neuroblox.PDVTargetMethod

PDVTarget Time series data is bandpass filtered and hilbert-transformed. Phase angle is computed in radians. Phase deviation is quantified as the angle difference between a given set of signals.

source
Neuroblox.PLVTargetMethod

PLVTarget Time series data is bandpass filtered and hilbert-transformed. Phase angle is computed in radians.

source
Neuroblox.ProtocolDBSMethod
ProtocolDBS(; name, namespace=nothing, frequency=130.0, amplitude=2.5,
               pulse_width=0.066, offset=0.0, start_time=0.0, smooth=1e-4,
               pulses_per_burst=10, bursts_per_block=12, 
-              pre_block_time=200.0, inter_burst_time=200.0)

Create a deep brain stimulation (DBS) stimulus consisting of a block of pulse bursts.

Arguments:

  • name: Name given to ODESystem object within the blox
  • namespace: Additional namespace above name if needed for inheritance
  • frequency: Pulse frequency in Hz
  • amplitude: Pulse amplitude in arbitrary units
  • pulse_width: Duration of each pulse in ms
  • offset: Baseline value of the signal between pulses
  • start_time: Time delay before stimulation begins in ms
  • smooth: Smoothing parameter for pulse transitions, set to 0 for sharp transitions
  • pulsesperburst: Number of pulses in each burst
  • burstsperblock: Number of bursts in the block
  • preblocktime: Time before the block starts in ms
  • interbursttime: Time between bursts in ms

Returns a DBS stimulus blox that outputs a block of pulse bursts.

source
Neuroblox.addnontunableparamsMethod
function addnontunableparams(param, model)
+              pre_block_time=200.0, inter_burst_time=200.0)

Create a deep brain stimulation (DBS) stimulus consisting of a block of pulse bursts.

Arguments:

  • name: Name given to ODESystem object within the blox
  • namespace: Additional namespace above name if needed for inheritance
  • frequency: Pulse frequency in Hz
  • amplitude: Pulse amplitude in arbitrary units
  • pulse_width: Duration of each pulse in ms
  • offset: Baseline value of the signal between pulses
  • start_time: Time delay before stimulation begins in ms
  • smooth: Smoothing parameter for pulse transitions, set to 0 for sharp transitions
  • pulsesperburst: Number of pulses in each burst
  • burstsperblock: Number of bursts in the block
  • preblocktime: Time before the block starts in ms
  • interbursttime: Time between bursts in ms

Returns a DBS stimulus blox that outputs a block of pulse bursts.

source
Neuroblox.addnontunableparamsMethod
function addnontunableparams(param, model)
 
 Function adds parameters of a model that were not marked as tunable to a list of tunable parameters
 and respects the MTK ordering of parameters.
@@ -92,12 +92,12 @@
 - `sys`: MTK system
 
 Returns:
-- `completeparamlist`: complete parameter list of a system, including those that were not tagged as tunable
source
Neuroblox.bandpassfilterMethod

bandpassfilter takes in time series data and bandpass filters it. It has the following inputs: data: time series data lb: minimum cut-off frequency ub: maximum cut-off frequency fs: sampling frequency order: filter order

source
Neuroblox.boldsignalMethod

Arguments:

  • name: Name given to ODESystem object within the blox.
  • lnϵ : logarithm of ratio of intra- to extra-vascular signal

NB: the prefix ln of the variables ν, q as well as the parameters ϵ denotes their transformation into logarithmic space to enforce their positivity.

Citations:

  1. Stephan K E, Weiskopf N, Drysdale P M, Robinson P A, and Friston K J. Comparing Hemodynamic Models with DCM. NeuroImage 38, no. 3 (2007): 387–401. doi: 10.1016/j.neuroimage.2007.07.040
  2. Hofmann D, Chesebro A G, Rackauckas C, Mujica-Parodi L R, Friston K J, Edelman A, and Strey H H. Leveraging Julia's Automated Differentiation and Symbolic Computation to Increase Spectral DCM Flexibility and Speed, 2023. doi: 10.1101/2023.10.27.564407
source
Neuroblox.complexwaveletFunction

complexwavelet creates a complex morlet wavelet by windowing a complex sine wave with a Gaussian taper. The morlet wavelet is a special case of a bandpass filter in which the frequency response is Gaussian-shaped. Convolution with a complex wavelet is equivalent to performing a Hilbert transform of a bandpass filtered signal.

It has the following inputs: data: time series data dt : data sampling rate lb : lower bound wavelet frequency (in Hz) ub : upper bound wavelet frequency (in Hz) a : amplitude of the Gaussian taper, default is 1 n : number of wavelet cycles of the Gaussian taper, defines the trade-off between temporal precision and frequency precision larger n gives better frequency precision at the cost of temporal precision default is 6 Hz m : x-axis offset, default is 0 num_wavelets : number of wavelets to create, default is 5

And outputs: complex_wavelet : a family of complex morlet wavelets

source
Neuroblox.csd2marMethod

This function converts a cross-spectral density (CSD) into a multivariate auto-regression (MAR) model. It first transforms the CSD into its cross-correlation function (Wiener-Kinchine theorem) and then computes the MAR model coefficients. csd : cross-spectral density matrix of size MxN; M: number of samples, N: number of cross-spectral dimensions (number of variables squared) w : frequencies dt : time step size p : number of time steps of auto-regressive model

This function returns coeff : array of length p of coefficient matrices of size sqrt(N)xsqrt(N) noise_cov : noise covariance matrix

source
Neuroblox.csd_approxMethod
This function implements equation 2 of the spectral DCM paper, Friston et al. 2014 "A DCM for resting state fMRI".
+- `completeparamlist`: complete parameter list of a system, including those that were not tagged as tunable
source
Neuroblox.bandpassfilterMethod

bandpassfilter takes in time series data and bandpass filters it. It has the following inputs: data: time series data lb: minimum cut-off frequency ub: maximum cut-off frequency fs: sampling frequency order: filter order

source
Neuroblox.boldsignalMethod

Arguments:

  • name: Name given to ODESystem object within the blox.
  • lnϵ : logarithm of ratio of intra- to extra-vascular signal

NB: the prefix ln of the variables ν, q as well as the parameters ϵ denotes their transformation into logarithmic space to enforce their positivity.

Citations:

  1. Stephan K E, Weiskopf N, Drysdale P M, Robinson P A, and Friston K J. Comparing Hemodynamic Models with DCM. NeuroImage 38, no. 3 (2007): 387–401. doi: 10.1016/j.neuroimage.2007.07.040
  2. Hofmann D, Chesebro A G, Rackauckas C, Mujica-Parodi L R, Friston K J, Edelman A, and Strey H H. Leveraging Julia's Automated Differentiation and Symbolic Computation to Increase Spectral DCM Flexibility and Speed, 2023. doi: 10.1101/2023.10.27.564407
source
Neuroblox.complexwaveletFunction

complexwavelet creates a complex morlet wavelet by windowing a complex sine wave with a Gaussian taper. The morlet wavelet is a special case of a bandpass filter in which the frequency response is Gaussian-shaped. Convolution with a complex wavelet is equivalent to performing a Hilbert transform of a bandpass filtered signal.

It has the following inputs: data: time series data dt : data sampling rate lb : lower bound wavelet frequency (in Hz) ub : upper bound wavelet frequency (in Hz) a : amplitude of the Gaussian taper, default is 1 n : number of wavelet cycles of the Gaussian taper, defines the trade-off between temporal precision and frequency precision larger n gives better frequency precision at the cost of temporal precision default is 6 Hz m : x-axis offset, default is 0 num_wavelets : number of wavelets to create, default is 5

And outputs: complex_wavelet : a family of complex morlet wavelets

source
Neuroblox.csd2marMethod

This function converts a cross-spectral density (CSD) into a multivariate auto-regression (MAR) model. It first transforms the CSD into its cross-correlation function (Wiener-Kinchine theorem) and then computes the MAR model coefficients. csd : cross-spectral density matrix of size MxN; M: number of samples, N: number of cross-spectral dimensions (number of variables squared) w : frequencies dt : time step size p : number of time steps of auto-regressive model

This function returns coeff : array of length p of coefficient matrices of size sqrt(N)xsqrt(N) noise_cov : noise covariance matrix

source
Neuroblox.csd_approxMethod
This function implements equation 2 of the spectral DCM paper, Friston et al. 2014 "A DCM for resting state fMRI".
 Note that nomenclature is taken from SPM12 code and it does not seem to coincide with the spectral DCM paper's nomenclature. 
 For instance, Gu should represent the spectral component due to external input according to the paper. However, in the code this represents
 the hidden state fluctuations (which are called Gν in the paper).
 Gn in the code corresponds to Ge in the paper, i.e. the observation noise. In the code global and local components are defined, no such distinction
-is discussed in the paper. In fact the parameter γ, corresponding to local component is not present in the paper.
source
Neuroblox.get_dynamic_statesMethod
function get_dynamic_states(sys)
+is discussed in the paper. In fact the parameter γ, corresponding to local component is not present in the paper.
source
Neuroblox.get_dynamic_statesMethod
function get_dynamic_states(sys)
 
 Function extracts states from the system that are dynamic variables, 
 get also indices of external inputs (u(t)) and measurements (like bold(t))
@@ -106,7 +106,7 @@
 
 Returns:
 - `sts`: states/unknowns of the system that are neither external inputs nor measurements, i.e. these are the dynamic states
-- `idx`: indices of these states
source
Neuroblox.get_input_equationsMethod
Returns the equations for all input variables of a system, 
 assuming they have a form like : `sys.input_variable ~ ...`
 so only the input appears on the LHS.
 
@@ -116,13 +116,13 @@
 
 If blox isa AbstractComponent, it is assumed that it contains a `connector` field,
 which holds a `Connector` object with all relevant connections 
-from lower levels and this level.
source
Neuroblox.idftMethod

Plain implementation of idft because AD dispatch versions for ifft don't work still!

source
Neuroblox.idftMethod

Plain implementation of idft because AD dispatch versions for ifft don't work still!

source
Neuroblox.inner_namespaceofMethod
Returns the complete namespace EXCLUDING the outermost (highest) level.
 This is useful for manually preparing equations (e.g. connections, see Connector),
-that will later be composed and will automatically get the outermost namespace.
source
Neuroblox.learningrateMethod

This function computes learning rate. It has the following inputs: outcomes: vector of 1's and 0's for behavioral outcomes windows: number of windows to split the outcome data into And the following outputs: rate: the learning rate across each window

source
Neuroblox.mar2csdMethod

This function converts multivariate auto-regression (MAR) model parameters to a cross-spectral density (CSD). A : coefficients of MAR model, array of length p, each element contains the regression coefficients for that particular time-lag. Σ : noise covariance matrix of MAR p : number of time lags freqs : frequencies at which to evaluate the CSD sf : sampling frequency

This function returns: csd : cross-spectral density matrix of size MxN; M: number of samples, N: number of cross-spectral dimensions (number of variables squared)

source
Neuroblox.mar_mlMethod

Maximum likelihood estimator of a multivariate, or vector auto-regressive model. y : MxN Data matrix where M is number of samples and N is number of dimensions p : time lag parameter, also called order of MAR model return values mar["A"] : model parameters is a NxNxP tensor, i.e. one NxN parameter matrix for each time bin k ∈ {1,...,p} mar["Σ"] : noise covariance matrix

source
Neuroblox.paramscopingMethod
function paramscoping(;tunable=true, kwargs...)
+that will later be composed and will automatically get the outermost namespace.
source
Neuroblox.learningrateMethod

This function computes learning rate. It has the following inputs: outcomes: vector of 1's and 0's for behavioral outcomes windows: number of windows to split the outcome data into And the following outputs: rate: the learning rate across each window

source
Neuroblox.mar2csdMethod

This function converts multivariate auto-regression (MAR) model parameters to a cross-spectral density (CSD). A : coefficients of MAR model, array of length p, each element contains the regression coefficients for that particular time-lag. Σ : noise covariance matrix of MAR p : number of time lags freqs : frequencies at which to evaluate the CSD sf : sampling frequency

This function returns: csd : cross-spectral density matrix of size MxN; M: number of samples, N: number of cross-spectral dimensions (number of variables squared)

source
Neuroblox.mar_mlMethod

Maximum likelihood estimator of a multivariate, or vector auto-regressive model. y : MxN Data matrix where M is number of samples and N is number of dimensions p : time lag parameter, also called order of MAR model return values mar["A"] : model parameters is a NxNxP tensor, i.e. one NxN parameter matrix for each time bin k ∈ {1,...,p} mar["Σ"] : noise covariance matrix

source
Neuroblox.paramscopingMethod
function paramscoping(;tunable=true, kwargs...)
 
 Scope arguments that are already a symbolic model parameter thereby keep the correct namespace 
 and make those that are not yet symbolic a symbol.
-Keyword arguments are used, because parameter definition require names, not just values.
source
Neuroblox.phase_cos_bloxMethod

phasecosblox is creating a cos with angular frequency ω and variable phase phaseinter has the following parameters: ω: angular frequency t: time phaseinter: a function that returns phase as a function of time and returns: the resulting value

Usage: phaseint = phaseinter(0:0.1:50,phasedata) phaseout(t) = phasecosblox(0.1,t,phaseint) which is now a function of time and can be used in an input blox you can also use the dot operator to calculate time-series signal = phaseout.(collect(0:0.01:50))

source
Neuroblox.phase_interMethod

phaseinter is creating a function that interpolates the phase data for any time given phaseinter has the following parameters: phaserange: a range, e.g. 0:0.1:50 which should reflect the time points of the data phasedata: phase at equidistant time points and returns: an function that returns an interpolated phase for t in range

source
Neuroblox.phase_sin_bloxMethod

phasesinblox is creating a sin with angular frequency ω and variable phase phaseinter has the following parameters: ω: angular frequency t: time phaseinter: a function that returns phase as a function of time and returns: the resulting value

Usage: phaseint = phaseinter(0:0.1:50,phasedata) phaseout(t) = phasesinblox(0.1,t,phaseint) which is now a function of time and can be used in an input blox you can also use the dot operator to calculate time-series signal = phaseout.(collect(0:0.01:50))

source
Neuroblox.random_initialsMethod

random_initials creates a vector of random initial conditions for an ODESystem that is composed of a list of blox. The function finds the initial conditions in the blox and then sets a random value in between range tuple given for that state.

It has the following inputs: odesys: ODESystem blox : list of blox

And outputs: u0 : Float64 vector of initial conditions

source
Neuroblox.setup_sDCMMethod
function setup_sDCM(data, stateevolutionmodel, initcond, csdsetup, priors, hyperpriors, indices)
+Keyword arguments are used, because parameter definition require names, not just values.
source
Neuroblox.phase_cos_bloxMethod

phasecosblox is creating a cos with angular frequency ω and variable phase phaseinter has the following parameters: ω: angular frequency t: time phaseinter: a function that returns phase as a function of time and returns: the resulting value

Usage: phaseint = phaseinter(0:0.1:50,phasedata) phaseout(t) = phasecosblox(0.1,t,phaseint) which is now a function of time and can be used in an input blox you can also use the dot operator to calculate time-series signal = phaseout.(collect(0:0.01:50))

source
Neuroblox.phase_interMethod

phaseinter is creating a function that interpolates the phase data for any time given phaseinter has the following parameters: phaserange: a range, e.g. 0:0.1:50 which should reflect the time points of the data phasedata: phase at equidistant time points and returns: an function that returns an interpolated phase for t in range

source
Neuroblox.phase_sin_bloxMethod

phasesinblox is creating a sin with angular frequency ω and variable phase phaseinter has the following parameters: ω: angular frequency t: time phaseinter: a function that returns phase as a function of time and returns: the resulting value

Usage: phaseint = phaseinter(0:0.1:50,phasedata) phaseout(t) = phasesinblox(0.1,t,phaseint) which is now a function of time and can be used in an input blox you can also use the dot operator to calculate time-series signal = phaseout.(collect(0:0.01:50))

source
Neuroblox.random_initialsMethod

random_initials creates a vector of random initial conditions for an ODESystem that is composed of a list of blox. The function finds the initial conditions in the blox and then sets a random value in between range tuple given for that state.

It has the following inputs: odesys: ODESystem blox : list of blox

And outputs: u0 : Float64 vector of initial conditions

source
Neuroblox.setup_sDCMMethod
function setup_sDCM(data, stateevolutionmodel, initcond, csdsetup, priors, hyperpriors, indices)
 
 Interface function to performs variational inference to fit model parameters to empirical cross spectral density.
 The current implementation provides a Variational Laplace fit (see function above `variationalbayes`).
@@ -142,15 +142,15 @@
 - `hyperpriors` : dataframe of parameters with the following columns:
 -- `Πλ_pr`      : prior precision matrix for λ hyperparameter(s)
 -- `μλ_pr`      : prior mean(s) for λ hyperparameter(s)
-- `indices`  : indices to separate model parameters from other parameters. Needed for the computation of AD gradient.
source
Neuroblox.spm_logdetMethod
function spm_logdet(M)
+- `indices`  : indices to separate model parameters from other parameters. Needed for the computation of AD gradient.
source
Neuroblox.spm_logdetMethod
function spm_logdet(M)
 
 SPM12 style implementation of the logarithm of the determinant of a matrix.
 
 Arguments:
-- `M`: matrix
source
Neuroblox.system_from_graphFunction
system_from_graph(g::MetaDiGraph, p=Num[]; name, simplify=true, graphdynamics=false, kwargs...)

Take in a MetaDiGraph g describing a network of neural structures (and optionally a vector of extra parameters p) and construct a System which can be used to construct various Problem types (i.e. ODEProblem) for use with DifferentialEquations.jl solvers.

If simplify is set to true (the default), then the resulting system will have structural_simplify called on it with any remaining keyword arguments forwared to structural_simplify. That is,

@named sys = system_from_graph(g; kwarg1=x, kwarg2=y)

is equivalent to

@named sys = system_from_graph(g; simplify=false)
-sys = structural_simplify(sys; kwarg1=x, kwarg2=y)

See the docstring for structural_simplify for information on which options it supports.

If graphdynamics=true (defaults to false), the output will be a GraphSystem from GraphDynamics.jl, and the kwargs will be sent to the GraphDynamics constructor instead of using ModelingToolkit.jl. The GraphDynamics.jl backend is typically significantly faster for large neural systems than the default backend, but is experimental and does not yet support all Neuroblox.jl features.

source
Neuroblox.system_from_graphFunction
system_from_graph(g::MetaDiGraph, p=Num[]; name, simplify=true, graphdynamics=false, kwargs...)

Take in a MetaDiGraph g describing a network of neural structures (and optionally a vector of extra parameters p) and construct a System which can be used to construct various Problem types (i.e. ODEProblem) for use with DifferentialEquations.jl solvers.

If simplify is set to true (the default), then the resulting system will have structural_simplify called on it with any remaining keyword arguments forwared to structural_simplify. That is,

@named sys = system_from_graph(g; kwarg1=x, kwarg2=y)

is equivalent to

@named sys = system_from_graph(g; simplify=false)
+sys = structural_simplify(sys; kwarg1=x, kwarg2=y)

See the docstring for structural_simplify for information on which options it supports.

If graphdynamics=true (defaults to false), the output will be a GraphSystem from GraphDynamics.jl, and the kwargs will be sent to the GraphDynamics constructor instead of using ModelingToolkit.jl. The GraphDynamics.jl backend is typically significantly faster for large neural systems than the default backend, but is experimental and does not yet support all Neuroblox.jl features.

source
Neuroblox.vecparamMethod
vecparam(param::OrderedDict)
 
 Function to flatten an ordered dictionary of model parameters and return a simple list of parameter values.
 
 Arguments:
-- `param`: dictionary of model parameters (may contain numbers and lists of numbers)
source
+- `param`: dictionary of model parameters (may contain numbers and lists of numbers)
source
diff --git a/dev/assets/Manifest.toml b/dev/assets/Manifest.toml index bd493a8..dd3f05a 100644 --- a/dev/assets/Manifest.toml +++ b/dev/assets/Manifest.toml @@ -1557,10 +1557,9 @@ uuid = "d8e11817-5142-5d16-987a-aa16d5891078" version = "0.4.17" [[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" +git-tree-sha1 = "72aebe0b5051e5143a079a4685a46da330a40472" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.13" +version = "0.5.15" [[deps.Makie]] deps = ["Animations", "Base64", "CRC32c", "ColorBrewer", "ColorSchemes", "ColorTypes", "Colors", "Contour", "DelaunayTriangulation", "Distributions", "DocStringExtensions", "Downloads", "FFMPEG_jll", "FileIO", "FilePaths", "FixedPointNumbers", "Format", "FreeType", "FreeTypeAbstraction", "GeometryBasics", "GridLayoutBase", "ImageIO", "InteractiveUtils", "IntervalSets", "Isoband", "KernelDensity", "LaTeXStrings", "LinearAlgebra", "MacroTools", "MakieCore", "Markdown", "MathTeXEngine", "Observables", "OffsetArrays", "Packing", "PlotUtils", "PolygonOps", "PrecompileTools", "Printf", "REPL", "Random", "RelocatableFolders", "Scratch", "ShaderAbstractions", "Showoff", "SignedDistanceFields", "SparseArrays", "Statistics", "StatsBase", "StatsFuns", "StructArrays", "TriplotBase", "UnicodeFun"] @@ -1716,10 +1715,10 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" [[deps.Neuroblox]] -deps = ["Accessors", "CSV", "ChainRules", "Combinatorics", "DSP", "DataFrames", "Distributions", "ExponentialUtilities", "ForwardDiff", "GraphDynamics", "Graphs", "Interpolations", "LinearAlgebra", "LogExpFunctions", "MetaGraphs", "ModelingToolkit", "ModelingToolkitStandardLibrary", "MuladdMacro", "OhMyThreads", "OrderedCollections", "Peaks", "Random", "RecursiveArrayTools", "Reexport", "SciMLBase", "SparseArrays", "Statistics", "StatsBase", "StochasticDiffEq", "Symbolics", "ToeplitzMatrices"] +deps = ["Accessors", "CSV", "ChainRules", "Colors", "Combinatorics", "DSP", "DataFrames", "Distributions", "ExponentialUtilities", "ForwardDiff", "GraphDynamics", "Graphs", "Interpolations", "LinearAlgebra", "LogExpFunctions", "MetaGraphs", "ModelingToolkit", "ModelingToolkitStandardLibrary", "MuladdMacro", "OhMyThreads", "OrderedCollections", "Peaks", "Random", "RecursiveArrayTools", "Reexport", "SciMLBase", "SparseArrays", "Statistics", "StatsBase", "StochasticDiffEq", "Symbolics", "ToeplitzMatrices"] path = "/home/runner/work/Neuroblox.jl/Neuroblox.jl" uuid = "769b91e5-4c60-41ee-bfae-153c84203cb2" -version = "0.5.3" +version = "0.5.4" weakdeps = ["CairoMakie", "Makie"] [deps.Neuroblox.extensions] diff --git a/dev/getting_started/index.html b/dev/getting_started/index.html index 23a927d..257832e 100644 --- a/dev/getting_started/index.html +++ b/dev/getting_started/index.html @@ -78,4 +78,4 @@ lines!(ax, sol.t, E1, label = "E") lines!(ax, sol.t, I1, label = "I") Legend(fig[1,2], ax) -figExample block output

[1] Wilson, H. R., & Cowan, J. D. (1972). Excitatory and inhibitory interactions in localized populations of model neurons. Biophysical journal, 12(1), 1-24.

[2] Destexhe, A., & Sejnowski, T. J. (2009). The Wilson–Cowan model, 36 years later. Biological cybernetics, 101(1), 1-2.


This page was generated using Literate.jl.

+figExample block output

[1] Wilson, H. R., & Cowan, J. D. (1972). Excitatory and inhibitory interactions in localized populations of model neurons. Biophysical journal, 12(1), 1-24.

[2] Destexhe, A., & Sejnowski, T. J. (2009). The Wilson–Cowan model, 36 years later. Biological cybernetics, 101(1), 1-2.


This page was generated using Literate.jl.

diff --git a/dev/index.html b/dev/index.html index b2cabca..018ccce 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Neuroblox · Neuroblox

Neuroblox

About

Neuroblox.jl is designed for computational neuroscience and psychiatry applications. Our tools range from control circuit system identification to brain circuit simulations bridging scales from spiking neurons to fMRI-derived circuits, parameter-fitting models to neuroimaging data, interactions between the brain and other physiological systems, experimental optimization, and scientific machine learning.

Description

Neuroblox.jl is based on a library of modular computational building blocks (“blox”) in the form of systems of symbolic dynamic differential equations that can be combined to describe large-scale brain dynamics. Once a model is built, it can be simulated efficiently and fit electrophysiological and neuroimaging data. Moreover, the circuit behavior of multiple model variants can be investigated to aid in distinguishing between competing hypotheses. We employ ModelingToolkit.jl to describe the dynamical behavior of blox as symbolic (stochastic/delay) differential equations. Our libraries of modular blox consist of individual neurons (Hodgkin-Huxley, IF, QIF, LIF, etc.), neural mass models (Jansen-Rit, Wilson-Cowan, Lauter-Breakspear, Next Generation, microcanonical circuits etc.) and biomimetically-constrained control circuit elements. A GUI designed to be intuitive to neuroscientists allows researchers to build models that automatically generate high-performance systems of numerical ordinary/stochastic differential equations from which one can run stimulations with parameters fit to experimental data. Our benchmarks show that the increase in speed for simulation often exceeds a factor of 100 as compared to neural mass model implementation by the Virtual Brain (python) and similar packages in MATLAB. For parameter fitting of brain circuit dynamical models, we use Turing.jl to perform probabilistic modeling, including Hamilton-Monte-Carlo sampling and Automated Differentiation Variational Inference.

Licensing

Neuroblox is free for non-commerical and academic use. For full details of the license, please see the Neuroblox EULA. For commercial use, get in contact with sales@neuroblox.org.

+Neuroblox · Neuroblox

Neuroblox

About

Neuroblox.jl is designed for computational neuroscience and psychiatry applications. Our tools range from control circuit system identification to brain circuit simulations bridging scales from spiking neurons to fMRI-derived circuits, parameter-fitting models to neuroimaging data, interactions between the brain and other physiological systems, experimental optimization, and scientific machine learning.

Description

Neuroblox.jl is based on a library of modular computational building blocks (“blox”) in the form of systems of symbolic dynamic differential equations that can be combined to describe large-scale brain dynamics. Once a model is built, it can be simulated efficiently and fit electrophysiological and neuroimaging data. Moreover, the circuit behavior of multiple model variants can be investigated to aid in distinguishing between competing hypotheses. We employ ModelingToolkit.jl to describe the dynamical behavior of blox as symbolic (stochastic/delay) differential equations. Our libraries of modular blox consist of individual neurons (Hodgkin-Huxley, IF, QIF, LIF, etc.), neural mass models (Jansen-Rit, Wilson-Cowan, Lauter-Breakspear, Next Generation, microcanonical circuits etc.) and biomimetically-constrained control circuit elements. A GUI designed to be intuitive to neuroscientists allows researchers to build models that automatically generate high-performance systems of numerical ordinary/stochastic differential equations from which one can run stimulations with parameters fit to experimental data. Our benchmarks show that the increase in speed for simulation often exceeds a factor of 100 as compared to neural mass model implementation by the Virtual Brain (python) and similar packages in MATLAB. For parameter fitting of brain circuit dynamical models, we use Turing.jl to perform probabilistic modeling, including Hamilton-Monte-Carlo sampling and Automated Differentiation Variational Inference.

Licensing

Neuroblox is free for non-commerical and academic use. For full details of the license, please see the Neuroblox EULA. For commercial use, get in contact with sales@neuroblox.org.

diff --git a/dev/install/index.html b/dev/install/index.html index 04c306b..a7c8c95 100644 --- a/dev/install/index.html +++ b/dev/install/index.html @@ -7,4 +7,4 @@ Downloads.download("raw.githubusercontent.com/Neuroblox/NeurobloxDocsHost/refs/heads/main/Project.toml", joinpath(@__DIR__, "Project.toml")) Pkg.activate(@__DIR__) -Pkg.instantiate()

Please note that after running these commands Neuroblox will also be installed along with all other packages that are used in the tutorials.

NOTE: If you want to install only Neuroblox and not the other packages used in the tutorials you can run

Pkg.add("Neuroblox")
+Pkg.instantiate()

Please note that after running these commands Neuroblox will also be installed along with all other packages that are used in the tutorials.

NOTE: If you want to install only Neuroblox and not the other packages used in the tutorials you can run

Pkg.add("Neuroblox")
diff --git a/dev/objects.inv b/dev/objects.inv index 843a245..28b3a56 100644 Binary files a/dev/objects.inv and b/dev/objects.inv differ diff --git a/dev/release_notes/index.html b/dev/release_notes/index.html index 0f2f6cd..9522457 100644 --- a/dev/release_notes/index.html +++ b/dev/release_notes/index.html @@ -1,2 +1,2 @@ -Release Notes · Neuroblox
+Release Notes · Neuroblox
diff --git a/dev/tutorials/basal_ganglia/index.html b/dev/tutorials/basal_ganglia/index.html index 950e0dd..bd799db 100644 --- a/dev/tutorials/basal_ganglia/index.html +++ b/dev/tutorials/basal_ganglia/index.html @@ -168,4 +168,4 @@ title = "STN (PD)") resize!(fig.scene, (1600, 900)) -figExample block output

We see the emergence of strong beta oscillations in the Parkinsonian condition compared to the baseline condition for all neural populations. This aligns with the findings of Adam et al. and reflects the pathological synchrony observed in Parkinson's disease.

References

Adam, Elie M., et al. "Deep brain stimulation in the subthalamic nucleus for Parkinson's disease can restore dynamics of striatal networks." Proceedings of the National Academy of Sciences 119.19 (2022): e2120808119.


This page was generated using Literate.jl.

+figExample block output

We see the emergence of strong beta oscillations in the Parkinsonian condition compared to the baseline condition for all neural populations. This aligns with the findings of Adam et al. and reflects the pathological synchrony observed in Parkinson's disease.

References

Adam, Elie M., et al. "Deep brain stimulation in the subthalamic nucleus for Parkinson's disease can restore dynamics of striatal networks." Proceedings of the National Academy of Sciences 119.19 (2022): e2120808119.


This page was generated using Literate.jl.

diff --git a/dev/tutorials/neural_assembly/index.html b/dev/tutorials/neural_assembly/index.html index 3814dd3..7a79e8e 100644 --- a/dev/tutorials/neural_assembly/index.html +++ b/dev/tutorials/neural_assembly/index.html @@ -182,4 +182,4 @@ fig = Figure(); ax = Axis(fig[1,1]; xlabel = "time (ms)", ylabel = "Voltage (mv)") lines!(ax, sol.t, mnv) -fig ## to display the figureExample block output

and finally the AC powerspectrum

powerspectrumplot(AC, sol)
Example block output

Sugestion : Try changing the image samples and notice the change in the spatial firing patterns in VAC and AC neurons. One can make multiple cortical blocks simillar to AC and connect them in various connection topologies. All of them can directly or indirectly get input from VAC.

References

[1] Pathak A., Brincat S., Organtzidis H., Strey H., Senneff S., Antzoulatos E., Mujica-Parodi L., Miller E., Granger R. Biomimetic model of corticostriatal micro-assemblies discovers new neural code., bioRxiv 2023.11.06.565902, 2024


This page was generated using Literate.jl.

+fig ## to display the figureExample block output

and finally the AC powerspectrum

powerspectrumplot(AC, sol)
Example block output

Sugestion : Try changing the image samples and notice the change in the spatial firing patterns in VAC and AC neurons. One can make multiple cortical blocks simillar to AC and connect them in various connection topologies. All of them can directly or indirectly get input from VAC.

References

[1] Pathak A., Brincat S., Organtzidis H., Strey H., Senneff S., Antzoulatos E., Mujica-Parodi L., Miller E., Granger R. Biomimetic model of corticostriatal micro-assemblies discovers new neural code., bioRxiv 2023.11.06.565902, 2024


This page was generated using Literate.jl.

diff --git a/dev/tutorials/parkinsons/index.html b/dev/tutorials/parkinsons/index.html index 6589d88..02c43b9 100644 --- a/dev/tutorials/parkinsons/index.html +++ b/dev/tutorials/parkinsons/index.html @@ -66,4 +66,4 @@ prob = remake(prob, tspan = (0.0, sim_dur)) ## Remake the ODEProblem with the new simulation time sol = solve(prob, Tsit5(), saveat=0.1); ## Solve the new problem

Let's use this new solution to plot the power spectrum of the D1 neuron population. This is using a built-in Neuroblox function $powerspectrumplot$ that's discussed at length in the next tutorial, so we won't delve into the details of the arguments here.

powerspectrumplot(D1, sol, state = "y", ## specify the block to plot, the solution object, and the state of the block to plot
                   method = welch_pgram, window = hanning, ## power spectrum estimation method
-                  title="D1 Population Power Spectrum")
Example block output

You should see two prominent β-band peaks: one in low β (around 15 Hz) and one in high β (around 35 Hz). You should also see their resonances in the γ-band.

Further Exploration

You might be wondering: what about Parkinson's in this model? Well, like all good things, that is left as an exercise for the reader. Following the original paper, try replacing the original parameters with Parkinson's versions, so that $C_Cor=60$, $C_BGTh=60$, $C_Cor➡BGTh=5$, and $C_BGTh➡Cor=5$. If you just change these values, you should see the D1 population have a dramatic increase in β power at the lower frequency peak and a complete loss of the higher frequency peak. We've selected the plotting parameters so you can use the same plotting call above to see this difference - so no excuse not to run this on your own! If you're inspired to continue experimenting, here are a couple other ideas:

References

[1] Liu, C, Zhou, C, Wang, J, Fietkiewicz, C, & Loparo, KA. (2020). The role of coupling connections in a model of the cortico-basal ganglia-thalamocortical neural loop for the generation of beta oscillations. Neural Networks, 123, 381-392. DOI: 10.1016/j.neunet.2019.12.021 [2] Jansen BH, Rit VG. Electroencephalogram and visual evoked potential generation in a mathematical model of coupled cortical columns. Biol Cybern. 1995 Sep;73(4):357-66. DOI: 10.1007/BF00199471.


This page was generated using Literate.jl.

+ title="D1 Population Power Spectrum")Example block output

You should see two prominent β-band peaks: one in low β (around 15 Hz) and one in high β (around 35 Hz). You should also see their resonances in the γ-band.

Further Exploration

You might be wondering: what about Parkinson's in this model? Well, like all good things, that is left as an exercise for the reader. Following the original paper, try replacing the original parameters with Parkinson's versions, so that $C_Cor=60$, $C_BGTh=60$, $C_Cor➡BGTh=5$, and $C_BGTh➡Cor=5$. If you just change these values, you should see the D1 population have a dramatic increase in β power at the lower frequency peak and a complete loss of the higher frequency peak. We've selected the plotting parameters so you can use the same plotting call above to see this difference - so no excuse not to run this on your own! If you're inspired to continue experimenting, here are a couple other ideas:

References

[1] Liu, C, Zhou, C, Wang, J, Fietkiewicz, C, & Loparo, KA. (2020). The role of coupling connections in a model of the cortico-basal ganglia-thalamocortical neural loop for the generation of beta oscillations. Neural Networks, 123, 381-392. DOI: 10.1016/j.neunet.2019.12.021 [2] Jansen BH, Rit VG. Electroencephalogram and visual evoked potential generation in a mathematical model of coupled cortical columns. Biol Cybern. 1995 Sep;73(4):357-66. DOI: 10.1007/BF00199471.


This page was generated using Literate.jl.

diff --git a/dev/tutorials/ping_network/index.html b/dev/tutorials/ping_network/index.html index ef3265b..b14f22f 100644 --- a/dev/tutorials/ping_network/index.html +++ b/dev/tutorials/ping_network/index.html @@ -46,4 +46,4 @@ sol = solve(prob, Tsit5(), saveat=0.1); ## Solve the problem and save at 0.1ms resolution.

Plotting the results

Now that we have a whole simulation, let's plot the results and see how they line up with the original figures. We're looking to reproduce the dynamics shown in Figure 1 of Börgers et al. [1]. To create raster plots in Neuroblox for the excitatory and inhibitory populations, it is as simple as:

fig = Figure()
 rasterplot(fig[1,1], exci, sol; threshold=20.0, title="Excitatory Neurons")
 rasterplot(fig[2,1], inhib, sol; threshold=20.0, title="Inhibitory Neurons")
-fig
Example block output

The upper panel should show the dynamics in Figure 1.C, with a clear population of excitatory neurons firing together from the external driving current, and the other excitatory neurons exhibiting more stochastic bursts. The lower panel should show the dynamics in Figure 1.A, with the inhibitory neurons firing in a more synchronous manner than the excitatory neurons.

Conclusion

And there you have it! A complete PING demonstration that reproduces the dynamics of a published paper in a matter of 30 seconds, give or take. Have fun making your own!

For further exploration

If you want to explore the PING network further, you can try the following:

  1. You might notice that the excitatory and inhibitory populations become slightly desynchronized by the end of the simulation, unlike in the original paper. This is because of slight differences in how we implement the excitatory drive and inhibitory bath, which adjusts the overall E/I balance. Try increasing the inhibitory bath or decreasing the percentage of excitatory neurons that receive input and see how this affects the synchrony!
  2. This tutorial is written entirely using built-in blocks for the excitatory and inhibitory neurons. If you want to explore the details, try typing $?PINGNeuronExci$ or $?PINGNeuronInhib$ in your Julia REPL to see the full details of the blocks. If you really want to dig into the details, type $@edit PINGNeuronExci()$ to open the source code and see how the equations are written.

References

  1. Börgers C, Epstein S, Kopell NJ. Gamma oscillations mediate stimulus competition and attentional selection in a cortical network model. Proc Natl Acad Sci U S A. 2008 Nov 18;105(46):18023-8. DOI: 10.1073/pnas.0809511105.
  2. Traub, RD, Miles, R. Neuronal Networks of the Hippocampus. Cambridge University Press, Cambridge, UK, 1991. DOI: 10.1017/CBO9780511895401
  3. Wang, X-J, Buzsáki, G. Gamma oscillation by synaptic inhibition in a hippocampal interneuronal network model. J. Neurosci., 16:6402–6413, 1996. DOI: 10.1523/JNEUROSCI.16-20-06402.1996

This page was generated using Literate.jl.

+figExample block output

The upper panel should show the dynamics in Figure 1.C, with a clear population of excitatory neurons firing together from the external driving current, and the other excitatory neurons exhibiting more stochastic bursts. The lower panel should show the dynamics in Figure 1.A, with the inhibitory neurons firing in a more synchronous manner than the excitatory neurons.

Conclusion

And there you have it! A complete PING demonstration that reproduces the dynamics of a published paper in a matter of 30 seconds, give or take. Have fun making your own!

For further exploration

If you want to explore the PING network further, you can try the following:

  1. You might notice that the excitatory and inhibitory populations become slightly desynchronized by the end of the simulation, unlike in the original paper. This is because of slight differences in how we implement the excitatory drive and inhibitory bath, which adjusts the overall E/I balance. Try increasing the inhibitory bath or decreasing the percentage of excitatory neurons that receive input and see how this affects the synchrony!
  2. This tutorial is written entirely using built-in blocks for the excitatory and inhibitory neurons. If you want to explore the details, try typing $?PINGNeuronExci$ or $?PINGNeuronInhib$ in your Julia REPL to see the full details of the blocks. If you really want to dig into the details, type $@edit PINGNeuronExci()$ to open the source code and see how the equations are written.

References

  1. Börgers C, Epstein S, Kopell NJ. Gamma oscillations mediate stimulus competition and attentional selection in a cortical network model. Proc Natl Acad Sci U S A. 2008 Nov 18;105(46):18023-8. DOI: 10.1073/pnas.0809511105.
  2. Traub, RD, Miles, R. Neuronal Networks of the Hippocampus. Cambridge University Press, Cambridge, UK, 1991. DOI: 10.1017/CBO9780511895401
  3. Wang, X-J, Buzsáki, G. Gamma oscillation by synaptic inhibition in a hippocampal interneuronal network model. J. Neurosci., 16:6402–6413, 1996. DOI: 10.1523/JNEUROSCI.16-20-06402.1996

This page was generated using Literate.jl.

diff --git a/dev/tutorials/resting_state/index.html b/dev/tutorials/resting_state/index.html index 96e4692..41127b4 100644 --- a/dev/tutorials/resting_state/index.html +++ b/dev/tutorials/resting_state/index.html @@ -87,4 +87,4 @@ heatmap!(ax[1], log10.(p) .* (p .< 0.05)) heatmap!(ax[2], wm) -figExample block output

Notice how the correlation heatmap qualitatively matches the sparsity structure that we printed above with wm_sparse.


This page was generated using Literate.jl.

+figExample block output

Notice how the correlation heatmap qualitatively matches the sparsity structure that we printed above with wm_sparse.


This page was generated using Literate.jl.

diff --git a/dev/tutorials/spectralDCM/index.html b/dev/tutorials/spectralDCM/index.html index e3bdc62..18f0018 100644 --- a/dev/tutorials/spectralDCM/index.html +++ b/dev/tutorials/spectralDCM/index.html @@ -225,4 +225,4 @@ iteration: 23 - F:3079.279392680642 - dF predicted:0.0037885150649157704 iteration: 24 - F:3079.282627218574 - dF predicted:0.00593298656638601 iteration: 25 - F:3079.2878438837383 - dF predicted:0.009058419383521577 -convergence

Plot Results

Free energy is the objective function of the optimization scheme of spectral DCM. Note that in the machine learning literature this it is called Evidence Lower Bound (ELBO). Plot the free energy evolution over optimization iterations to see how the algorithm converges towards a (potentially local) optimum:

freeenergy(state)
Example block output

Plot the estimated posterior of the effective connectivity and compare that to the true parameter values. Bar hight are the posterior mean and error bars are the standard deviation of the posterior.

ecbarplot(state, setup, A_true)
Example block output

References

[1] Novelli, Leonardo, Karl Friston, and Adeel Razi. “Spectral Dynamic Causal Modeling: A Didactic Introduction and Its Relationship with Functional Connectivity.” Network Neuroscience 8, no. 1 (April 1, 2024): 178–202.
[2] Hofmann, David, Anthony G. Chesebro, Chris Rackauckas, Lilianne R. Mujica-Parodi, Karl J. Friston, Alan Edelman, and Helmut H. Strey. “Leveraging Julia’s Automated Differentiation and Symbolic Computation to Increase Spectral DCM Flexibility and Speed.” bioRxiv: The Preprint Server for Biology, 2023.
[3] Friston, Karl J., Joshua Kahan, Bharat Biswal, and Adeel Razi. “A DCM for Resting State fMRI.” NeuroImage 94 (July 2014): 396–407.


This page was generated using Literate.jl.

+convergence

Plot Results

Free energy is the objective function of the optimization scheme of spectral DCM. Note that in the machine learning literature this it is called Evidence Lower Bound (ELBO). Plot the free energy evolution over optimization iterations to see how the algorithm converges towards a (potentially local) optimum:

freeenergy(state)
Example block output

Plot the estimated posterior of the effective connectivity and compare that to the true parameter values. Bar hight are the posterior mean and error bars are the standard deviation of the posterior.

ecbarplot(state, setup, A_true)
Example block output

References

[1] Novelli, Leonardo, Karl Friston, and Adeel Razi. “Spectral Dynamic Causal Modeling: A Didactic Introduction and Its Relationship with Functional Connectivity.” Network Neuroscience 8, no. 1 (April 1, 2024): 178–202.
[2] Hofmann, David, Anthony G. Chesebro, Chris Rackauckas, Lilianne R. Mujica-Parodi, Karl J. Friston, Alan Edelman, and Helmut H. Strey. “Leveraging Julia’s Automated Differentiation and Symbolic Computation to Increase Spectral DCM Flexibility and Speed.” bioRxiv: The Preprint Server for Biology, 2023.
[3] Friston, Karl J., Joshua Kahan, Bharat Biswal, and Adeel Razi. “A DCM for Resting State fMRI.” NeuroImage 94 (July 2014): 396–407.


This page was generated using Literate.jl.