MeanFieldGraph

Documentation for MeanFieldGraph package.

MeanFieldGraph.DiscreteTimeDataType
DiscreteTimeData(X)

A binary discrete time data of length T with N dimensions.

Arguments

  • X::Matrix{Bool}: X[i, t] gives the presence or absence of an event at time t for component i.
length(data)                # Get the time length of data
size(data)                  # Get the dimensions of data, i.e. `(N,T)`
data[:,range::UnitRange]    # Extract the data in the time interval `range`.
source
MeanFieldGraph.MarkovChainConnectivityType
MarkovChainConnectivity(model,θ)

A Markov Chain model with parameters given by model and connectivity matrix given by θ.

Arguments

  • model::MarkovChainModel: contains the parameters μ, λ and p.
  • θ::Matrix{Bool}: θ[i, j] gives the presence or absence of the influence of component j onto component i.
size(connec)        # Get the number of components.

Remark

Since the connectiviy matrix is specified, the parameter model.p is not used.

source
Base.randMethod
rand(modelconnec::MarkovChainConnectivity, excitatory::Vector{Bool}, T::Int)

Simulate a realization of a Markov Chain model with a specified connectivity matrix.

Arguments

  • modelconnec::MarkovChainConnectivity: a MarkovChainModel with a specified connectivity matrix θ.
  • excitatory::Vector{Bool}: true coordinates correspond to excitatory components and false coordinates correspond to inhibitory components.
  • T::Int: Time length of the simulation.
using MeanFieldGraph
model = MarkovChainModel(.5, .5, .5)
θ = [[1 1];[0 1]]
modelconnec = MarkovChainConnectivity(model,θ)
excitatory = [true, false]

using Random
Random.seed!(1)
data = rand(modelconnec, excitatory, 10)
data.X

# output

2×10 Matrix{Bool}:
 1  0  0  0  1  1  1  1  1  1
 1  0  1  1  0  1  0  1  1  0
source
Base.randMethod
rand(model::MarkovChainModel, excitatory::Vector{Bool}, T::Int)

Simulate a realization of a Markov Chain model without a specified connectivity matrix.

Arguments

  • model::MarkovChainModel: contains the parameters μ, λ and p.
  • excitatory::Vector{Bool}: true coordinates correspond to excitatory components and false coordinates correspond to inhibitory components.
  • T::Int: Time length of the simulation.

Remark

It generates a connectivity matrix according to an Erdos-Rényi graph with parameter p and then apply the method rand(modelconnec::MarkovChainConnectivity, excitatory::Vector{Bool}, T::Int). ```

source
MeanFieldGraph.classificationMethod
classification(data::DiscreteTimeData)

Estimates the two underlying communities (one excitatory and one inhibitory) from the data set data. It returns a Vector{Bool} where the true coordinates correspond to excitatory components and false coordinates correspond to inhibitory components.

source
MeanFieldGraph.estimatorsFunction
estimators(data::DiscreteTimeData, Δ::Int=floor(Int,log(length(data))))

Compute the estimators $\hat{m}$, $\hat{v}$ and $\hat{w}$ on a data set data with tuning parameter Δ.

Remark

If the value Δ = 0 is chosen, then it is replaced by its default value floor(Int,log(length(data)))

source
MeanFieldGraph.mvwMethod
mvw(μ, λ, p, r₊)

Compute the targets m, v and w corresponding to the parameters μ, λ, p and the ratio of excitatory components r₊.

The mathematical expressions are:

\[\begin{aligned} m &= \frac{\mu+(1-\lambda)pr_-}{1-p(1-\lambda)(r_+-r_-)},\ v &= (1-\lambda)^2 p(1-p)((m-r_-)^2+r_+r_-) , \ w &= m(1-m)\frac{1+4(1-\lambda)^2p^2r_+r_-}{(1-p(1-\lambda)(r_+-r_-))^2}. \end{aligned}\]

Arguments

  • μ: Spontaneous event probability
  • λ: Interaction parameter
  • p: Edge probability
  • r₊: ratio of excitatory components
source
MeanFieldGraph.mvw_infMethod
mvw_inf(modelconnec::MarkovChainConnectivity, excitatory::Vector{Bool})

Compute the limit of the three estimators $\hat{m}$, $\hat{v}$ and $\hat{w}$ when $T\to \infty$.

The mathematical expressions are:

\[\begin{aligned} m_\infty = \overline{m^N}, \ v_\infty = \sum_{i=1}^N (m^N_i - \overline{m^N})^2 , \ w_\infty = \frac{1}{N} \sum_{i=1}^N (c^N_i)^2 m^N_i (1 - m^N_i) , \end{aligned}\]

Arguments

  • modelconnec::MarkovChainConnectivity: a MarkovChainModel with a specified connectivity matrix θ.
  • excitatory::Vector{Bool}: true coordinates correspond to excitatory components and false coordinates correspond to inhibitory components.
source
RecipesBase.plotMethod
plot(data::DiscreteTimeData)

Plot a black and white image corresponding to data. Black pixels correspond to the value 1. The x-axis correspond to time and y-axis correspond to components.

source
StatsAPI.fitMethod
fit(::Type{MarkovChainModel}, data::DiscreteTimeData, r₊; Δ::Int=floor(Int,log(length(data))))

Fit a MarkovChainModel to a data set data with asymptotic excitatory proportion r₊.

Keyword argument

  • Δ: tuning parameter of the method. Its default value is the floor of $\log(T)$ where $T$ is the time length of data.
source