Framework for analyzing critical dynamics in neural systems. Covers neuronal avalanches, power-law distributions, self-organized criticality (SOC), and their implications for brain function. Activation: criticality, avalanches, power-law, SOC, neural criticality.
Neural criticality refers to the hypothesis that the brain operates near a critical point, balancing between order and disorder. This framework provides methods to analyze critical dynamics in neural systems, including neuronal avalanches, power-law distributions, and self-organized criticality.
Neuronal avalanches are cascades of activity that propagate through neural networks, characterized by:
Critical systems exhibit power-law distributions:
P(x) = C * x^(-α)
Where α (alpha) is the power-law exponent. For neuronal avalanches: α ≈ 1.5 (theoretical) or α ≈ 2.0 (experimental)
SOC is a property of dynamical systems that naturally evolve to a critical state without external tuning.
import numpy as np
def detect_avalanches(spike_times, bin_size=0.001, threshold=0):
"""Detect neuronal avalanches from spike data."""
max_time = np.max(spike_times)
bins = np.arange(0, max_time + bin_size, bin_size)
spike_counts, _ = np.histogram(spike_times, bins=bins)
avalanches = []
in_avalanche = False
current_avalanche = []
for count in spike_counts:
if count > threshold:
if not in_avalanche:
in_avalanche = True
current_avalanche = []
current_avalanche.append(count)
else:
if in_avalanche:
avalanches.append(current_avalanche)
in_avalanche = False
sizes = [sum(a) for a in avalanches]
durations = [len(a) for a in avalanches]
return sizes, durations
def fit_power_law(data, xmin=None):
"""Fit power-law distribution using maximum likelihood."""
if xmin is None:
xmin = min(data)
filtered_data = data[data >= xmin]
n = len(filtered_data)
alpha = 1 + n / np.sum(np.log(filtered_data / xmin))
return alpha, xmin
def analyze_criticality(spike_times, sampling_rate=1000):
"""Complete criticality analysis pipeline."""
sizes, durations = detect_avalanches(spike_times, bin_size=1.0/sampling_rate)
alpha_size, _ = fit_power_law(np.array(sizes))
sigma = 1 - 1/np.mean(sizes) if np.mean(sizes) > 1 else 0
is_critical = 1.3 < alpha_size < 1.7 and 0.9 < sigma < 1.1
return {
'alpha_size': alpha_size,
'branching_ratio': sigma,
'is_critical': is_critical,
'num_avalanches': len(sizes)
}
使用此技能时遵循以下流程:
User: 请帮我应用此技能
Agent: 我将按照标准流程执行...
User: 有更复杂的场景需要处理
Agent: 针对复杂场景,我将采用以下策略...
execreadwrite