The Virtual Brain Project

Table Of Contents

Previous topic

tvb Package

Next topic

basic Package

This Page

analyzers Package

correlation_coefficient

Calculate temporal cross correlation coefficients (Pearson’s coefficient) on a TimeSeries datatype and return a graph.CorrelationCoefficients dataype. The correlation matrix is widely used to represent functional connectivity (FC).

tvb.analyzers.correlation_coefficient.CorrelationCoefficient[source]

Compute the node-pairwise pearson correlation coefficient of the given input 4D TimeSeries datatype.

Return a CrossCorrelation datatype, whose values of are between -1 and 1, inclusive.

See: http://docs.scipy.org/doc/numpy/reference/generated/numpy.corrcoef.html

traits on this class:

t_end (\(t_{end}\))
End time point (ms)
default: 1000.0
t_start (\(t_{start}\))
Time start point (ms). By default it uses the default Monitor sample period. The starting time point of a time series is not zero, but the monitor’s sample period.
default: 0.9765625
time_series (Time Series)
The time-series for which the cross correlation matrices are calculated.
default: None

cross_correlation

Calculate temporal cross correlation on a TimeSeries datatype and return a temporal_correlations.CrossCorrelation dataype.

tvb.analyzers.cross_correlation.CrossCorrelate[source]

Compute the node-pairwise cross-correlation of the given input 4D TimeSeries DataType.

Return a CrossCorrelation DataType. It contains the cross-correlation sequences for all possible combinations of the nodes.

See: http://www.scipy.org/doc/api_docs/SciPy.signal.signaltools.html#correlate

traits on this class:

time_series (Time Series)
The time-series for which the cross correlation sequences are calculated.
default: None

fcd_matrix

Adapter that uses the traits module to generate interfaces for ... Analyzer.

tvb.analyzers.fcd_matrix.FcdCalculator[source]

The present class will do the following actions:

  • Compute the the fcd of the timeseries; the fcd is calculated in the following way:

    the time series is divided in time window of fixed length and with an overlapping of fixed length. The data-points within each window, centered at time ti, are used to calculate FC(ti) as Pearson correlation. The ij element of the FCD matrix is calculated as the Pearson correlation between FC(ti) and FC(tj) -in a vector

  • Apply to the fcd the spectral embedding algorithm in order to calculate epochs of stability of the fcd

    (length of time during which FC matrix are high correlated).

The algorithm can produce 2 kind of results:

  • case 1: the algorithm is able to identify the epochs of stability

    – fcs calculated over the epochs of stability (excluded the first one = artifact, due to initial conditions) – 3 eigenvectors, associated to the 3 largest eigenvalues, of the fcs are extracted

  • case 2: the algorithm is not able to identify the epochs of stability

    – fc over the all time series is calculated – 3 first eigenvectors, associated to the 3 largest eigenvalues, of the fcs are extracted

:return
  • fcd matrix whose values are between -1 and 1, inclusive.

  • in case 1: fcd matrix segmented i.e. fcd whose values are between -1 and 1.1, inclusive.

    (Value=1.1 for time not belonging to epochs of stability identified with spectral embedding algorithm) in case 2: fcd matrix segmented identical to the fcd matrix not segmented

  • dictionary containing the eigenvectors.

  • dictionary containing the eigenvalues

  • connectivity associated to the TimeSeriesRegions

traits on this class:

sp (Spanning between two consecutive sliding window (ms))
Spanning= (time windows length)-(overlapping between two consecutive time window). FCD matrix is calculated in the following way: the time series is divided in time window of fixed length and with an overlapping of fixed length. The datapoints within each window, centered at time ti, are used to calculate FC(ti) as Pearson Correlation. The ij element of the FCD matrix is calculated as the Pearson correlation between FC(ti) and FC(tj) arranged in a vector
default: 2000
sw (Sliding window length (ms))
Length of the time window used to divided the time series. FCD matrix is calculated in the following way: the time series is divided in time window of fixed length and with an overlapping of fixed length. The datapoints within each window, centered at time ti, are used to calculate FC(ti) as Pearson correlation. The ij element of the FCD matrix is calculated as the Pearson Correlation between FC(ti) and FC(tj) arranged in a vector.
default: 120000
time_series (Time Series)
The time-series for which the fcd matrices are calculated.
default: None
tvb.analyzers.fcd_matrix.compute_radii(xi, centered=False)[source]
tvb.analyzers.fcd_matrix.epochs_interval(xir, xir_cutoff, sp, sw)[source]
tvb.analyzers.fcd_matrix.spectral_dbscan(fcd, n_dim=2, eps=0.3, min_samples=50)[source]
tvb.analyzers.fcd_matrix.spectral_embedding(fcd)[source]

fft

Calculate an FFT on a TimeSeries DataType and return a FourierSpectrum DataType.

tvb.analyzers.fft.FFT[source]

A class for calculating the FFT of a TimeSeries object of TVB and returning a FourierSpectrum object. A segment length and windowing function can be optionally specified. By default the time series is segmented into 1 second blocks and no windowing function is applied.

traits on this class:

detrend (Detrending)
Detrending is not always appropriate. Default is True, False means no detrending is performed on the time series
default: True
segment_length (Segment(window) length (ms))
The TimeSeries can be segmented into equally sized blocks (overlapping if necessary). The segment length determines the frequency resolution of the resulting power spectra – longer windows produce finer frequency resolution.
default: 1000.0
time_series (Time Series)
The TimeSeries to which the FFT is to be applied.
default: None
window_function (Windowing function)
Windowing functions can be applied before the FFT is performed. Default is None, possibilities are: ‘hamming’; ‘bartlett’; ‘blackman’; and ‘hanning’. See, numpy.<function_name>.
default: None

fmri_balloon

Implementation of differet BOLD signal models. Four different models are distinguished:

  • CBM_N: Classical BOLD Model Non-linear
  • CBM_L: Classical BOLD Model Linear
  • RBM_N: Revised BOLD Model Non-linear (default)
  • RBM_L: Revised BOLD Model Linear

Classical means that the coefficients used to compute the BOLD signal are derived as described in [Obata2004] . Revised coefficients are defined in [Stephan2007]

References:

[Stephan2007]Stephan KE, Weiskopf N, Drysdale PM, Robinson PA, Friston KJ (2007) Comparing hemodynamic models with DCM. NeuroImage 38: 387-401.
[Obata2004]Obata, T.; Liu, T. T.; Miller, K. L.; Luh, W. M.; Wong, E. C.; Frank, L. R. & Buxton, R. B. (2004) Discrepancies between BOLD and flow dynamics in primary and supplementary motor areas: application of the balloon model to the interpretation of BOLD transients. Neuroimage, 21:144-153
tvb.analyzers.fmri_balloon.BalloonModel[source]

A class for calculating the simulated BOLD signal given a TimeSeries object of TVB and returning another TimeSeries object.

The haemodynamic model parameters based on constants for a 1.5 T scanner.

traits on this class:

E0 (\(E_0\))
BOLD parameter. Resting oxygen extraction fraction.
default: 0.4
RBM (Revised BOLD Model)
Select classical vs revised BOLD model (CBM or RBM). Coefficients k1, k2 and k3 will be derived accordingly.
default: True
TE (\(TE\))
BOLD parameter. Echo Time
default: 0.04
V0 (\(V_0\))
BOLD parameter. Resting blood volume fraction.
default: 4.0
alpha (\(\tau_f\))
Balloon model parameter. Stiffness parameter. Grubb’s exponent.
default: 0.32
bold_model (Select BOLD model equations)
Select the set of equations for the BOLD model.
default: [‘nonlinear’]
dt (\(dt\))
The integration time step size for the balloon model (s). If none is provided, by default, the TimeSeries sample period is used.
default: 0.002
epsilon (\(\epsilon\))
BOLD parameter. Ratio of intra- and extravascular signals. In principle this parameter could be derived from empirical data and spatialized.
default: [ 0.5]
range: low = 0.5 ; high = 2.0
integrator (Integration scheme)
A tvb.simulator.Integrator object which is an integration scheme with supporting attributes such as integration step size and noise specification for stochastic methods. It is used to compute the time courses of the balloon model state variables.
default: <class ‘tvb.simulator.integrators.HeunDeterministic’>
neural_input_transformation (Neural input transformation)
This represents the operation to perform on the state-variable(s) of the model used to generate the input TimeSeries. none takes the first state-variable as neural input; `` abs_diff`` is the absolute value of the derivative (first order difference) of the first state variable; sum: sum all the state-variables of the input TimeSeries.
default: [‘none’]
nu_0 (\(\nu_0\))
BOLD parameter. Frequency offset at the outer surface of magnetized vessels (Hz).
default: 40.3
r_0 (\(r_0\))
BOLD parameter. Slope r0 of intravascular relaxation rate (Hz). Only used for revised coefficients.
default: 25.0
tau_f (\(\tau_f\))
Balloon model parameter. Time of flow-dependent elimination or feedback regulation (s). The average time blood take to traverse the venous compartment. It is the ratio of resting blood volume (V0) to resting blood flow (F0).
default: 0.41
tau_o (\(\tau_o\))
Balloon model parameter. Haemodynamic transit time (s). The average time blood take to traverse the venous compartment. It is the ratio of resting blood volume (V0) to resting blood flow (F0).
default: 0.98
tau_s (\(\tau_s\))
Balloon model parameter. Time of signal decay (s)
default: 0.65
time_series (Time Series)
The timeseries that represents the input neural activity
default: None

graph

Useful graph analyses.

tvb.analyzers.graph.betweenness_bin(A)[source]

Node betweenness centrality is the fraction of all shortest paths in the network that contain a given node. Nodes with high values of betweenness centrality participate in a large number of shortest paths.

Parameters:A – binary (directed/undirected) connection matrix (array)
Returns:BC: a vector representing node between centrality vector.

Notes:

Betweenness centrality may be normalised to the range [0,1] as BC/[(N-1)(N-2)], where N is the number of nodes in the network.

Original Mika Rubinov, UNSW/U Cambridge, 2007-2012 - From BCT 2012-12-04

Reference: [1] Kintali (2008) arXiv:0809.1906v2 [cs.DS] (generalization to directed and disconnected graphs)

Author: Paula Sanz Leon

tvb.analyzers.graph.distance_inv(G)[source]

Compute the inverse shortest path lengths of G.

Parameters:G – binary undirected connection matrix
Returns:D: matrix of inverse distances
tvb.analyzers.graph.efficiency_bin(A, compute_local_efficiency=False)[source]

Computes global efficiency or local efficiency of a connectivity matrix. The global efficiency is the average of inverse shortest path length, and is inversely related to the characteristic path length.

The local efficiency is the global efficiency computed on the neighborhood of the node, and is related to the clustering coefficient.

Parameters:
  • A – array; binary undirected connectivity matrix.
  • compute_local_efficiency – bool, optional flag to compute either local or global efficiency of the network.
Returns:

  • global efficiency (float)
  • local efficiency (array)

References: [1] Latora and Marchiori (2001) Phys Rev Lett 87:198701.

Note

Algorithm: algebraic path count

Note

Original: Mika Rubinov, UNSW, 2008-2010 - From BCT 2012-12-04

Note

Tested with Numpy 1.7

Warning

tested against Matlab version... needs indexing improvement

Example:

>>> import numpy.random
>>> A = np.random.rand(5, 5)
>>> E = efficiency_bin(A)
>>> E.shape == (1, ) 
>>> True

If you want to compute the local efficiency for every node in the network:

>>> E = efficiency_bin(A, compute_local_efficiency=True)
>>> E.shape == (5, 1)
>>> True

Author: Paula Sanz Leon

tvb.analyzers.graph.get_components_sizes(A)[source]

Get connected components sizes. Returns the size of the largest component of an undirected graph specified by the binary and undirected connection matrix A.

Parameters:A – array - binary undirected (BU) connectivity matrix.
Returns:
  • largest component (float)
  • size of the largest component
Raises:Value Error - If A is not square.

Warning

Requires NetworkX

Author: Paula Sanz Leon

tvb.analyzers.graph.sequential_random_deletion(white_matter, random_sequence, nor)[source]

A strategy to lesion a connectivity matrix.

A single node is removed at each step until the network is reduced to only 2 nodes. This method represents a structural failure analysis and it should be run several times with different random sequences.

Parameters:
  • white_matter – tvb Connectivity DataType (yes, it’s an example for TVB!) a connectivity DataType that has a ‘weights’ attribute.
  • random_sequence – int array; a sequence of random integer numbers indicating which the nodes will be deleted at each step.
  • nor – number of nodes of the original connectivity matrix.
Returns:

  • Node strength (number_of_nodes, number_of_nodes -2)
  • Node degree (number_of_nodes, number_of_nodes -2)
  • Global efficiency (number_of_nodes, )
  • Size of the largest component (number_of_nodes, )

References: Alstott et al. (2009).

Author: Paula Sanz Leon

tvb.analyzers.graph.sequential_targeted_deletion(white_matter, nor)[source]

A strategy to lesion a connectivity matrix.

A single node is removed at each step until the network is reduced to only 2 nodes. At each step different graph metrics are computed (degree, strength and betweenness centrality). The single node with the highest degree, strength or centrality is removed.

Parameters:
  • white_matter – tvb Connectivity datatype (yes, it’s an example for TVB!) a connectivity datatype that has a ‘weights’ attribute.
  • nor – number of nodes of the original connectivity matrix.
Returns:

  • Node strength (number_of_nodes, number_of_nodes -2) array
  • Node degree (number_of_nodes, number_of_nodes -2) array
  • Betweenness centrality (number_of_nodes, number_of_nodes -2) array
  • Global efficiency (number_of_nodes, 3) array
  • Size of the largest component (number_of_nodes, 3) array

See also: sequential_random_deletion, localized_area_deletion

References: Alstott et al. (2009).

Author: Paula Sanz Leon

ica

Perform Independent Component Analysis on a TimeSeries Object and returns an IndependentComponents datatype.

tvb.analyzers.ica.fastICA[source]

Takes a TimeSeries datatype (x) and returns the unmixed temporal sources (S) and the estimated mixing matrix (A).

Math:x = A S

ICA takes time-points as observations and nodes as variables.

It uses the FastICA algorithm implemented in the scikit-learn toolkit, and its intended usage is as a blind source separation method.

See also: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.fastica.html#sklearn.decomposition.fastica

traits on this class:

n_components (Number of principal components to unmix.)
Number of principal components to unmix.
default: None
time_series (Time Series)
The timeseries to which the ICA is to be applied.
default: None

info

This module implements information theoretic analyses.

TODO: Fix docstring of sampen TODO: Convert sampen to a traited class

tvb.analyzers.info.sampen(y, m=2, r=None, qse=False, taus=1, info=False, tile=<function tile at 0x7f7223d71500>, na=None, abs=<ufunc 'absolute'>, log=<ufunc 'log'>, r_=<numpy.lib.index_tricks.RClass object at 0x7f7223de4250>)[source]

Computes (quadratic) sample entropy of a given input signal y, with embedding dimension n, and a match tolerance of r (ref 2). If an array of scale factors, taus, are given, the signal will be coarsened by each factor and a corresponding entropy will be computed (ref 1). If no value for r is given, it will be set to 0.15*y.std().

Currently, the implementation is lazy and expects or coerces scale factors to integer values.

With qse=True (default) the probability p is normalized for the value of r, giving the quadratic sample entropy, such that results from different values of r can be meaningfully compared (ref 2).

ref 1: Costa, M., Goldberger, A. L., and Peng C.-K. (2002) Multiscale Entropy
Analysis of Complex Physiologic Time Series. Phys Rev Lett 89 (6).
ref 2: Lake, D. E. and Moorman, J. R. (2010) Accurate estimation of entropy
in very short physiological time series. Am J Physiol Heart Circ Physiol

To check that algorithm is working, look at ref 1, fig 1, and run

>>> sampen(randn(3*10000), r=.15, taus=r_[1:20], qse=False, m=2)

metric_kuramoto_index

Filler analyzer: Takes a TimeSeries object and returns a Float.

tvb.analyzers.metric_kuramoto_index.KuramotoIndex[source]

Return the Kuramoto synchronization index.

Useful metric for a parameter analysis when the collective brain dynamics represent coupled oscillatory processes.

The order parameters are \(r\) and \(Psi\).

\[r e^{i * \psi} = \frac{1}{N}\,\sum_{k=1}^N(e^{i*\theta_k})\]

The first is the phase coherence of the population of oscillators (KSI) and the second is the average phase.

When \(r=0\) means 0 coherence among oscillators.

Input: TimeSeries DataType

Output: Float

This is a crude indicator of synchronization among nodes over the entire network.

#NOTE: For the time being it is meant to be another global metric. However, it should be consider to have a sort of TimeSeriesDatatype for this analyzer.

traits on this class:

segment (Segmentation factor)
Divide the input time-series into discrete equally sized sequences and use the last segment to compute the metric. It is only used when the start point is larger than the time-series length.
default: 4
start_point (Start point (ms))
The start point determines how many points of the TimeSeries will be discarded before computing the metric. By default it drops the first 500 ms.
default: 500.0
time_series (Time Series)
The TimeSeries for which the metric(s) will be computed.
default: None

metric_proxy_metastability

Filler analyzer: Takes a TimeSeries object and returns two Floats.

These metrics are described and used in:

Hellyer et al. The Control of Global Brain Dynamics: Opposing Actions of Frontoparietal Control and Default Mode Networks on Attention. The Journal of Neuroscience, January 8, 2014, 34(2):451– 461

Proxy of spatial coherence (V):

Proxy metastability (M): the variability in spatial coherence of the signal globally or locally (within a network) over time.

Proxy synchrony (S) : the reciprocal of mean spatial variance across time.

tvb.analyzers.metric_proxy_metastability.ProxyMetastabilitySynchrony[source]

Subtract the mean time-series and compute.

Input: TimeSeries DataType

Output: Float, Float

The two metrics given by this analyzers are a proxy for metastability and synchrony. The underlying dynamical model used in the article was the Kuramoto model.

\[\begin{split}V(t) &= \frac{1}{N} \sum_{i=1}^{N} |S_i(t) - <S(t)>| \\ M(t) &= \sqrt{E[V(t)^{2}]-(E[V(t)])^{2}} \\ S(t) &= \frac{1}{\bar{V(t)}}\end{split}\]

traits on this class:

segment (Segmentation factor)
Divide the input time-series into discrete equally sized sequences and use the last segment to compute the metric. It is only used when the start point is larger than the time-series length.
default: 4
start_point (Start point (ms))
The start point determines how many points of the TimeSeries will be discarded before computing the metric. By default it drops the first 500 ms.
default: 500.0
time_series (Time Series)
The TimeSeries for which the metric(s) will be computed.
default: None
tvb.analyzers.metric_proxy_metastability.remove_mean(x, axis)[source]

Remove mean from numpy array along axis

metric_variance_global

Filler analyzer: Takes a TimeSeries object and returns a Float.

tvb.analyzers.metric_variance_global.GlobalVariance[source]

Zero-centres all the time-series and then calculates the variance over all data points.

Input: TimeSeries DataType

Output: Float

This is a crude indicator of “excitability” or oscillation amplitude of the models over the entire network.

traits on this class:

segment (Segmentation factor)
Divide the input time-series into discrete equally sized sequences and use the last segment to compute the metric. It is only used when the start point is larger than the time-series length.
default: 4
start_point (Start point (ms))
The start point determines how many points of the TimeSeries will be discarded before computing the metric. By default it drops the first 500 ms.
default: 500.0
time_series (Time Series)
The TimeSeries for which the metric(s) will be computed.
default: None

metric_variance_of_node_variance

Filler analyzer: Takes a TimeSeries object and returns a Float.

tvb.analyzers.metric_variance_of_node_variance.VarianceNodeVariance[source]

Zero-centres all the time-series, calculates the variance for each node time-series and returns the variance of the node variances.

Input: TimeSeries DataType

Output: Float

This is a crude indicator of how different the “excitability” of the model is from node to node.

traits on this class:

segment (Segmentation factor)
Divide the input time-series into discrete equally sized sequences and use the last segment to compute the metric. It is only used when the start point is larger than the time-series length.
default: 4
start_point (Start point (ms))
The start point determines how many points of the TimeSeries will be discarded before computing the metric. By default it drops the first 500 ms.
default: 500.0
time_series (Time Series)
The TimeSeries for which the metric(s) will be computed.
default: None

metrics_base

tvb.analyzers.metrics_base.BaseTimeseriesMetricAlgorithm[source]

This is a base class for all metrics on timeSeries dataTypes. Metric means an algorithm computing a single value for an entire TimeSeries.

traits on this class:

segment (Segmentation factor)
Divide the input time-series into discrete equally sized sequences and use the last segment to compute the metric. It is only used when the start point is larger than the time-series length.
default: 4
start_point (Start point (ms))
The start point determines how many points of the TimeSeries will be discarded before computing the metric. By default it drops the first 500 ms.
default: 500.0
time_series (Time Series)
The TimeSeries for which the metric(s) will be computed.
default: None

node_coherence

Compute cross coherence between all nodes in a time series.

tvb.analyzers.node_coherence.NodeCoherence[source]

Adapter for cross-coherence algorithm(s) traits on this class:

nfft (Data-points per block)
Should be a power of 2...
default: 256
time_series (Time Series)
The timeseries to which the FFT is to be applied.
default: None
tvb.analyzers.node_coherence.coherence(data, sample_rate, nfft=256, imag=False)[source]

Vectorized coherence calculation by windowed FFT

tvb.analyzers.node_coherence.coherence_mlab(data, sample_rate, nfft=256)[source]
tvb.analyzers.node_coherence.hamming(M, sym=True)[source]

The M-point Hamming window. From scipy.signal

node_complex_coherence

Calculate the cross spectrum and complex coherence on a TimeSeries datatype and return a ComplexCoherence datatype.

tvb.analyzers.node_complex_coherence.NodeComplexCoherence[source]

A class for calculating the FFT of a TimeSeries and returning a ComplexCoherenceSpectrum datatype.

This algorithm is based on the matlab function data2cs_event.m written by Guido Nolte:
[Freyer_2012]Freyer, F.; Reinacher, M.; Nolte, G.; Dinse, H. R. and Ritter, P. Repetitive tactile stimulation changes resting-state functional connectivity-implications for treatment of sensorimotor decline. Front Hum Neurosci, Bernstein Focus State Dependencies of Learning and Bernstein Center for Computational Neuroscience Berlin, Germany., 2012, 6, 144

Input: originally the input could be 2D (tpts x nodes/channels), and it was possible to give a 3D array (e.g., tpspt x nodes/cahnnels x trials) via the segment_length attribute. Current TVB implementation can handle 4D or 2D TimeSeries datatypes. Be warned: the 4D TimeSeries will be averaged and squeezed.

Output: (main arrays) - the cross-spectrum - the complex coherence, from which the imaginary part can be extracted

By default the time series is segmented into 1 second epoch blocks and 0.5 second 50% overlapping segments to which a Hanning function is applied.

traits on this class:

average_segments (Average across segments)
Flag. If True, compute the mean Cross Spectrum across segments.
default: True
detrend_ts (Detrend time series)
Flag. If True removes linear trend along the time dimension before applying FFT.
default: False
epoch_length (Epoch length [ms])
In general for lengthy EEG recordings (~30 min), the timeseries are divided into equally sized segments (~ 20-40s). These contain the event that is to be characterized by means of the cross coherence. Additionally each epoch block will be further divided into segments to which the FFT will be applied.
default: 1000.0
max_freq (Maximum frequency)
Maximum frequency points (e.g. 32., 64., 128.) represented in the output. Default is segment_length / 2 + 1.
default: 1024.0
npat (dummy variable)
This attribute appears to be related to an input projection matrix... Which is not yet implemented
default: 1.0
segment_length (Segment length [ms])
The timeseries can be segmented into equally sized blocks (overlapping if necessary). The segment length determines the frequency resolution of the resulting power spectra – longer windows produce finer frequency resolution.
default: 500.0
segment_shift (Segment shift [ms])
Time length by which neighboring segments are shifted. e.g. segment shift = segment_length / 2 means 50% overlapping segments.
default: 250.0
subtract_epoch_average (Subtract average across epochs)
Flag. If True and if the number of epochs is > 1, you can optionally subtract the mean across epochs before computing the complex coherence.
default: True
time_series (Time Series)
The timeseries for which the CrossCoherence and ComplexCoherence is to be computed.
default: None
window_function (Windowing function)
Windowing functions can be applied before the FFT is performed. Default is hanning, possibilities are: ‘hamming’; ‘bartlett’; ‘blackman’; and ‘hanning’. See, numpy.<function_name>.
default: hanning
zeropad (Zeropadding)
Adds n zeros at the end of each segment and at the end of window_function. It is not yet functional.
default: 0

node_covariance

Calculate a ... on a .. datatype and return a ...

tvb.analyzers.node_covariance.NodeCovariance[source]

Compute the temporal covariance of nodes in a TimeSeries dataType. A nodes x nodes matrix is returned for each (state-variable, mode).

traits on this class:

time_series (Time Series)
The timeseries to which the NodeCovariance is to be applied.
default: None

pca

Perform Principal Component Analysis (PCA) on a TimeSeries datatype and return a PrincipalComponents datatype.

tvb.analyzers.pca.PCA[source]

Return principal component weights and the fraction of the variance that they explain.

PCA takes time-points as observations and nodes as variables.

NOTE: The TimeSeries must be longer(more time-points) than the number of
nodes – Mostly a problem for TimeSeriesSurface datatypes, which, if sampled at 1024Hz, would need to be greater than 16 seconds long.

traits on this class:

time_series (Time Series)
The timeseries to which the PCA is to be applied. NOTE: The TimeSeries must be longer(more time-points) than the number of nodes – Mostly a problem for surface times-series, which, if sampled at 1024Hz, would need to be greater than 16 seconds long.
default: None

wavelet

Calculate a wavelet transform on a TimeSeries datatype and return a WaveletSpectrum datatype.

tvb.analyzers.wavelet.ContinuousWaveletTransform[source]

A class for calculating the wavelet transform of a TimeSeries object of TVB and returning a WaveletSpectrum object. The sampling period and frequency range of the result can be specified. The mother wavelet can also be specified... (So far, only Morlet.)

References:
[TBetal_1996]C. Tallon-Baudry et al, Stimulus Specificity of Phase-Locked and Non-Phase-Locked 40 Hz Visual Responses in Human., J Neurosci 16(13):4240-4249, 1996.
[Mallat_1999]S. Mallat, A wavelet tour of signal processing., book, Academic Press, 1999.

traits on this class:

frequencies (Frequency range of result (kHz).)
The frequency resolution and range returned. Requested frequencies are converted internally into appropriate scales.
default: Range(bound=False, value=None)
mother (Wavelet function)
The mother wavelet function used in the transform. Default is ‘morlet’, possibilities are: ‘morlet’...
default: morlet
normalisation (Normalisation)
The type of normalisation for the resulting wavet spectrum. Default is ‘energy’, options are: ‘energy’; ‘gabor’.
default: energy
q_ratio (Q-ratio)
NFC. Must be greater than 5. Ratios of the center frequencies to bandwidths.
default: 5.0
sample_period (Sample period of result (ms))
The sampling period of the computed wavelet spectrum. NOTE: This should be an integral multiple of the of the sampling period of the source time series, otherwise the actual resulting sample period will be the first correct value below that requested.
default: 7.8125
time_series (Time Series)
The timeseries to which the wavelet is to be applied.
default: None