Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit f532057

Browse files
authored
Merge pull request DynamicsAndNeuralSystems#26 from anniegbryant/sonnet_dev
Incorporate option for reduced set of SPIs
2 parents e69a1ee + cefe623 commit f532057

File tree

2 files changed

+86
-1
lines changed

2 files changed

+86
-1
lines changed

pyspi/calculator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ class Calculator:
3232
Any set of strings by which you want to label the calculator. This can be useful later for classification purposes, defaults to None.
3333
fast (bool, optional):
3434
If True, use a hand-picked set of ~210 SPIs that compute quickly but are still relatively comprehensive, defaults to False.
35+
sonnet (bool, optional):
36+
If True, use a hand-picked set of 14 SPIs that represent the set of 14 hierarchical clusters of SPIs detailed in the preprint, defaults to False.
3537
configfile (str, optional):
3638
The location of the YAML configuration file. See :ref:`Using a reduced SPI set`, defaults to :code:`'</path/to/pyspi>/pyspi/config.yaml'`
3739
"""
3840

3941
def __init__(
40-
self, dataset=None, name=None, labels=None, fast=False, configfile=None
42+
self, dataset=None, name=None, labels=None, fast=False, sonnet=False, configfile=None
4143
):
4244
self._spis = {}
4345

@@ -46,6 +48,10 @@ def __init__(
4648
configfile = (
4749
os.path.dirname(os.path.abspath(__file__)) + "/fast_config.yaml"
4850
)
51+
elif sonnet is True:
52+
configfile = (
53+
os.path.dirname(os.path.abspath(__file__)) + "/sonnet_config.yaml"
54+
)
4955
else:
5056
configfile = os.path.dirname(os.path.abspath(__file__)) + "/config.yaml"
5157
self._load_yaml(configfile)

pyspi/sonnet_config.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Basic statistics
2+
.statistics.basic:
3+
# Covariance
4+
Covariance:
5+
- estimator: EmpiricalCovariance
6+
7+
.statistics.distance:
8+
DynamicTimeWarping:
9+
- global_constraint: itakura
10+
11+
Barycenter:
12+
- mode: dtw
13+
statistic: mean
14+
15+
.statistics.causal:
16+
17+
# Additive noise model
18+
AdditiveNoiseModel:
19+
20+
21+
# Information-theoretic statistics
22+
.statistics.infotheory:
23+
DirectedInfo: # No theiler window yet
24+
- estimator: gaussian
25+
26+
# Transfer entropy
27+
TransferEntropy:
28+
- estimator: kraskov
29+
prop_k: 4
30+
auto_embed_method: MAX_CORR_AIS
31+
k_search_max: 10
32+
tau_search_max: 4
33+
dyn_corr_excl: AUTO
34+
35+
# Integrated information
36+
IntegratedInformation:
37+
- phitype: 'star'
38+
39+
# statistics that analyse in the frequency-domain (see Schoegl and Supp, 2006)
40+
.statistics.spectral:
41+
42+
CoherenceMagnitude:
43+
- fs: 1
44+
45+
PhaseSlopeIndex:
46+
- fmin: 0
47+
fmax: 0.5
48+
49+
PhaseLagIndex:
50+
51+
- fs: 1
52+
statistic: max
53+
54+
SpectralGrangerCausality:
55+
# Non-parametric Granger causality (no VAR model)
56+
- method: nonparametric
57+
fmin: 0
58+
fmax: 0.5
59+
statistic: mean
60+
61+
# statistics that analyse in the wavlet-domain (only Mortlet wavelet's at the moment)
62+
.statistics.wavelet:
63+
PhaseSlopeIndex:
64+
- fs: 1
65+
66+
.statistics.misc:
67+
# Cointegration
68+
Cointegration:
69+
- method: aeg
70+
statistic: tstat
71+
autolag: aic
72+
maxlag: 10
73+
trend: ct
74+
75+
# Power envelope correlation
76+
PowerEnvelopeCorrelation:
77+
- orth: False
78+
log: False
79+
absolute: False

0 commit comments

Comments
 (0)