Lecture series: Data analysis

85
Lecture series: Data analysis Lectures: Each Tuesday at 16:00 (First lecture: May 21, last lecture: June 25) Thomas Kreuz, ISC, CNR [email protected] http://www.fi.isc.cnr.it/users/thomas.kreuz /

description

Lecture series: Data analysis. Thomas Kreuz , ISC, CNR [email protected] http://www.fi.isc.cnr.it/users/thomas.kreuz /. Lectures: Each Tuesday at 16:00 (First lecture: May 21, last lecture: June 25 ). (Very preliminary) Schedule. - PowerPoint PPT Presentation

Transcript of Lecture series: Data analysis

Page 1: Lecture series: Data analysis

Lecture series: Data analysis

Lectures: Each Tuesday at 16:00

(First lecture: May 21, last lecture: June 25)

Thomas Kreuz, ISC, CNR [email protected]

http://www.fi.isc.cnr.it/users/thomas.kreuz/

Page 2: Lecture series: Data analysis

• Lecture 1: Example (Epilepsy & spike train synchrony), Data acquisition, Dynamical systems

• Lecture 2: Linear measures, Introduction to non-linear dynamics

• Lecture 3: Non-linear measures

• Lecture 4: Measures of continuous synchronization (EEG)

• Lecture 5: Application to non-linear model systems and to epileptic seizure prediction, Surrogates

• Lecture 6: Measures of (multi-neuron) spike train synchrony

(Very preliminary) Schedule

Page 3: Lecture series: Data analysis

• Example: Epileptic seizure prediction

• Data acquisition

• Introduction to dynamical systems

Last lecture

Page 4: Lecture series: Data analysis

Epileptic seizure prediction

Epilepsy results from abnormal, hypersynchronous neuronal activity in the brain

Accessible brain time series:EEG (standard) and neuronal spike trains (recent)

Does a pre-ictal state exist (ictus = seizure)?

Do characterizing measures allow a reliable detection of this state?

Specific example for prediction of extreme events

Page 5: Lecture series: Data analysis

Data acquisition

Sensor

System / Object

Amplifier AD-Converter

Computer

Filter

Sampling

Page 6: Lecture series: Data analysis

Dynamical system

• Described by time-dependent states

• Evolution of state

- continuous (flow)

- discrete (map)

can be both be linear or non-linear

• Example: sufficient sampling of sine wave (2 sampling values per cycle)

Control parameter

Page 7: Lecture series: Data analysis

Non-linear model systems

Linear measures

Introduction to non-linear dynamics

Non-linear measures

- Introduction to phase space reconstruction

- Lyapunov exponent

Today’s lecture

[Acknowledgement: K. Lehnertz, University of Bonn, Germany]

Page 8: Lecture series: Data analysis

Non-linear model systems

Page 9: Lecture series: Data analysis

Non-linear model systems

Continuous Flows

• Rössler system

• Lorenz system

Discrete maps

• Logistic map

• Hénon map

Page 10: Lecture series: Data analysis

Logistic map

r - Control parameter

• Model of population dynamics • Classical example of how complex, chaotic behaviour can

arise from very simple non-linear dynamical equations

[R. M. May. Simple mathematical models with very complicated dynamics. Nature, 261:459, 1976]

𝑟=4

Page 11: Lecture series: Data analysis

Hénon map

• Introduced by Michel Hénon as a simplified model of the Poincaré section of the Lorenz model

• One of the most studied examples of dynamical systems that exhibit chaotic behavior

[M. Hénon. A two-dimensional mapping with a strange attractor. Commun. Math. Phys., 50:69, 1976]

Page 12: Lecture series: Data analysis

Rössler system

• designed in 1976, for purely theoretical reasons• later found to be useful in modeling equilibrium in

chemical reactions

[O. E. Rössler. An equation for continuous chaos. Phys. Lett. A, 57:397, 1976]

Page 13: Lecture series: Data analysis

Lorenz system

• Developed in 1963 as a simplified mathematical model for atmospheric convection

• Arise in simplified models for lasers, dynamos, electric circuits, and chemical reactions

[E. N. Lorenz. Deterministic non-periodic flow. J. Atmos. Sci., 20:130, 1963]

Page 14: Lecture series: Data analysis

Linear measures

Page 15: Lecture series: Data analysis

Linearity

Dynamic of system (and thus of any time series measured from the system) is linear if:

H describes the dynamics and two state vectors

• Superposition:

• Homogeneity: scalar

Linearity:

Page 16: Lecture series: Data analysis

Overview

• Static measures

- Moments of amplitude distribution (1st – 4th)

• Dynamic measures

- Autocorrelation- Fourier spectrum- Wavelet spectrum

Page 17: Lecture series: Data analysis

Static measures

• Based on analysis of distributions (e.g. amplitudes)

• Do not contain any information about dynamics

• Example: Moments of a distribution - First moment: Mean - Second moment: Variance - Third moment: Skewness - Fourth moment: Kurtosis

Page 18: Lecture series: Data analysis

First moment: Mean

Average of distribution

Page 19: Lecture series: Data analysis

Second moment: Variance

Width of distribution(Variability, dispersion)

Standard deviation

Page 20: Lecture series: Data analysis

Third moment: Skewness

Degree of asymmetry of distribution(relative to normal distribution)

< 0 - asymmetric, more negative tailsSkewness = 0 - symmetric > 0 - asymmetric, more positive tails

Page 21: Lecture series: Data analysis

Fourth moment: Kurtosis

Degree of flatness / steepness of distribution(relative to normal distribution)

< 0 - platykurtic (flat)Kurtosis = 0 - mesokurtic (normal) > 0 - leptokurtic (peaked)

Page 22: Lecture series: Data analysis

Dynamic measures

Autocorrelation Fourier spectrum

[ Cross correlation Covariance ]

Time domain Frequency domain

x (t)Amplitude

Fx()

Frequency amplitudeComplex number Phase

Physical phenomenon

Time series

Page 23: Lecture series: Data analysis

Autocorrelation

)()0( XXXX CC

Time domain: Dependence on time lag

One signal with

(Normalized to zero mean and unit variance)

0)(

0 1)( 1

''

XX

N

nnn

XX

C

xxNC

Page 24: Lecture series: Data analysis

Autocorrelation: Examples

periodic stochastic memory

𝜏 𝜏 𝜏

Page 25: Lecture series: Data analysis

Discrete Fourier transform

Condition:

Fourier series (sines and cosines):

Fourier coefficients:

Fourier series (complex exponentials):

Fourier coefficients:

Page 26: Lecture series: Data analysis

Power spectrum

Parseval’s theorem:

𝑃 (𝜔)=∫−∞

|𝑥 (𝑡 )|2𝑑𝑡=∫−∞

|𝐹 𝑋 (𝜔 )|2𝑑𝜔Overall power:

=

Wiener-Khinchin theorem:

𝐶𝑋𝑋 (𝜏 )=∫−∞

𝑃 (𝜔)𝑒𝑖 𝜏𝜔𝑑𝜔𝑃 (𝜔)=∫−∞

𝐶𝑋𝑋(𝜏 )𝑒− 𝑖𝜏𝜔𝑑𝜏

Page 27: Lecture series: Data analysis

Tapering: Window functionsFourier transform assumes periodicity Edge effectSolution: Tapering (zeros at the edges)

Page 28: Lecture series: Data analysis

EEG frequency bands

[Buzsáki. Rhythms of the brain. Oxford University Press, 2006]

Description of brain rhythms

• Delta: 0.5 – 4 Hz

• Theta: 4 – 8 Hz

• Alpha: 8 – 12 Hz

• Beta: 12 – 30 Hz

• Gamma: > 30 Hz

Page 29: Lecture series: Data analysis

Example: White noise

Page 30: Lecture series: Data analysis

Example: Rössler system

Page 31: Lecture series: Data analysis

Example: Lorenz system

Page 32: Lecture series: Data analysis

Example: Hénon map

Page 33: Lecture series: Data analysis

Example: Inter-ictal EEG

Page 34: Lecture series: Data analysis

Example: Ictal EEG

Page 35: Lecture series: Data analysis

Time-frequency representation

Page 36: Lecture series: Data analysis

Wavelet analysisBasis functions with finite support

Example: complex Morlet wavelet

– scaling; – shift / translation(Mother wavelet: , )

Implementation via filter banks (cascaded lowpass & highpass):

– lowpass(approximation) – highpass(detail)

Page 37: Lecture series: Data analysis

Wavelet analysis: Example

[Latka et al. Wavelet mapping of sleep splindles in epilepsy, JPP, 2005]

Advantages:

- Localized in both frequency and time

- Mother wavelet canbe selected accordingto the feature of interest

Further applications:- Filtering- Denoising- Compression

Pow

er

Page 38: Lecture series: Data analysis

Introduction tonon-linear dynamics

Page 39: Lecture series: Data analysis

Linear systems

• Weak causality

identical causes have the same effect (strong idealization, not realistic in experimental situations)

• Strong causality

similar causes have similar effects (includes weak causality applicable to experimental situations, small deviations in initial conditions; external disturbances)

Page 40: Lecture series: Data analysis

Non-linear systems

Violation of strong causality

Similar causes can have different effects

Sensitive dependence on initial conditions

(Deterministic chaos)

Page 41: Lecture series: Data analysis

Linearity / Non-linearity

Non-linear systems- can have complicated solutions- Changes of parameters and initial conditions lead to non-

proportional effects

Non-linear systems are the rule, linear system is special case!

Linear systems- have simple solutions- Changes of parameters and initial

conditions lead to proportional effects

Page 42: Lecture series: Data analysis

Phase space example: Pendulum

Velocity v(t)

Position x(t)

t

State space:

Time series:

Page 43: Lecture series: Data analysis

Phase space example: Pendulum

Ideal world: Real world:

Page 44: Lecture series: Data analysis

Phase space

Phase space: space in which all possible states of a system are represented, with each possible system state corresponding to one unique point in a d dimensional cartesian space (d - number of system variables)

Pendulum: d = 2 (position, velocity)

Trajectory: time-ordered set of states of a dynamical system, movement in phase space (continuous for flows, discrete for maps)

Page 45: Lecture series: Data analysis

Vector fields in phase space Dynamical system described by time-dependent states

– d-dimensional phase space

– Vector field (assignment of a vector to each point in a subset of Euclidean space)

Examples:- Speed and direction of a moving fluid- Strength and direction of a magnetic force

Here: Flow in phase space Initial condition Trajectory (t)

Page 46: Lecture series: Data analysis

Divergence

Rate of change of an infinitesimal volume around a given point of a vector field:

- Source: outgoing flow ( with , expansion)

- Sink: incoming flow ( with , contraction)

Page 47: Lecture series: Data analysis

System classification via divergence

Liouville’s theorem:

Temporal evolution of an infinitesimal volume:

conservative (Hamiltonian) systems

dissipative systems

instable systems

Page 48: Lecture series: Data analysis

Dynamical systems in the real world

• In the real world internal and external friction leads to dissipation

• Impossibility of perpetuum mobile (without continuous driving / energy input, the motion stops)

• When disturbed, a system, after some initial transients, settles on its typical behavior (stationary dynamics)

• Attractor: Part of the phase space of the dynamical system corresponding to the typical behavior.

Page 49: Lecture series: Data analysis

Attractor

Subset X of phase space which satisfies three conditions:

• X is forward invariant under f: If x is an element of X, then so is f(t,x) for all t > 0.

• There exists a neighborhood of X, called the basin of attraction B(X), which consists of all points b that "enter X in the limit t → ∞".

• There is no proper subset of X having the first two properties.

Page 50: Lecture series: Data analysis

Attractor classification

Fixed point: point that is mapped to itself

Limit cycle: periodic orbit of the system that is isolated (i.e., has its own basin of attraction)

Limit torus: quasi-periodic motion defined by n incommensurate frequencies (n-torus)

Strange attractor: Attractor with a fractal structure

(2-torus)

Page 51: Lecture series: Data analysis

Introduction tophase space reconstruction

Page 52: Lecture series: Data analysis

Phase space reconstruction• Dynamical equations known (e.g. Lorenz, Rössler):

System variables span d-dimensional phase space

• Real world: Information incomplete

Typical situation: - Measurement of just one or a few system variables (observables) - Dimension (number of system variables, degrees of freedom) unknown - Noise - Limited recording time - Limited precision

Reconstruction of phase space possible?

Page 53: Lecture series: Data analysis

Taken’s embedding theoremTrajectory of a dynamical system in - dimensional phase space .

One observable measured via some measurement function :

; M:

It is possible to reconstruct a topologically equivalent attractor via time delay embedding:

- time lag, delay; – embedding dimension

[F. Takens. Detecting strange attractors in turbulence. Springer, Berlin, 1980]

Page 54: Lecture series: Data analysis

Taken’s embedding theoremMain idea: Inaccessible degrees of freedoms are coupled into the observable variable via the system dynamics.

Mathematical assumptions:

- Observation function and its derivative must be differentiable - Derivative must be of full rank (no symmetries in components) - Whitney’s theorem: Embedding dimension

Some generalizations:Embedding theorem by Sauer, Yorke, Casdagli

[Whitney. Differentiable manifolds. Ann Math,1936; Sauer et al. Embeddology. J Stat Phys, 1991.]

Page 55: Lecture series: Data analysis

Topological equivalence

original reconstructed

Page 56: Lecture series: Data analysis

Example: White noise

Page 57: Lecture series: Data analysis

Example: Rössler system

Page 58: Lecture series: Data analysis

Example: Lorenz system

Page 59: Lecture series: Data analysis

Example: Hénon map

Page 60: Lecture series: Data analysis

Example: Inter-ictal EEG

Page 61: Lecture series: Data analysis

Example: Ictal EEG

Page 62: Lecture series: Data analysis

Real time seriesPhase space reconstruction / Embedding:First step for many non-linear measures

Choice of parameters:

Window length T - Not too long (Stationarity, control parameters constant) - Not too short (sufficient density of phase space required)

Embedding parameters - Time delay - Embedding dimension

Page 63: Lecture series: Data analysis

Influence of time delaySelection of time delay (given optimal embedding dimension)

• too small: - Correlation in time dominate - No visible structure - Attractor not unfolded

• too large: - Overlay of attractor regions that are rather separated in the original attractor - Attractor overfolded

• optimal: Attractor unfolded

Page 64: Lecture series: Data analysis

Influence of time delay

too small too large

optimal:

Page 65: Lecture series: Data analysis

Criterion: Selection of time delay

Aim: Independence of successive values

• First zero crossing of autocorrelation function (only linear correlations)

• First minimum of mutual information function (also takes into account non-linear correlations)

[Mutual information: how much does knowledge of tell you about ]

Page 66: Lecture series: Data analysis

Criterion: Selection of embedding dimensionAim: Unfolding of attractor (no projections)

• Attractor dimension known: Whitney’s theorem:

• Attractor dimension unknown (typical for real time series):

Method of false nearest neighbors: Trajectory crossings, phase space neighbors close: Increase of distance between phase space neighbors

Procedure: - For given m count neighbors with distance - Check if count decreases for larger (if yes some were false nearest neighbors) - Repeat until number of nearest neighbors constant

[Kennel & Abarbanel, Phys Rev A 1992]

Page 67: Lecture series: Data analysis

Non-linear measures

Page 68: Lecture series: Data analysis

Non-linear deterministic systems

• No analytic solution of non-linear differential equations

• Superposition of solutions not necessarily a solution

• Behavior of system qualitatively rich e.g. change of dynamics in dependence of control parameter (bifurcations)

• Sensitive dependence on initial conditions

Deterministic chaos

Page 69: Lecture series: Data analysis

Bifurcation diagram: Logistic mapBifurcation: Dynamic change in dependence of control parameter

Fixed point Period doubling Chaos

Page 70: Lecture series: Data analysis

Deterministic chaos

• Chaos (every-day use): - State of disorder and irregularity

• Deterministic chaos - irregular (non-periodic) evolution of state variables - unpredictable (or only short-time predictability) - described by deterministic state equations (in contrast to stochastic systems) - shows instabilities and recurrences

Page 71: Lecture series: Data analysis

Deterministic chaosregular chaotic random

deterministic deterministic stochastic

Long-time predictions possible

Rather un-predictable

unpredictable

Strong causality No strong causalityNon-linearity

Uncontrolled (external) influences

Page 72: Lecture series: Data analysis

Characterization of non-linear systems

Linear meaures:

• Static measures (e.g. moments of amplitude distribution):

- Some hints on non-linearity- No information about dynamics

• Dynamic measures (autocorrelation and Fourier spectrum)

Autocorrelation Fourier

Fast decay, no memory Typically broadband

Distinction from noise?

Wiener-Khinchin-Theorem

Page 73: Lecture series: Data analysis

Characterizition of a dynamic in phase space

Predictability

(Information / Entropy)Density

Self-similarityLinearity / Non-linearity

Determinism /Stochasticity

(Dimension)

Stability (sensitivityto initial conditions)

Page 74: Lecture series: Data analysis

Lyapunov-exponent

Page 75: Lecture series: Data analysis

Stability

Analysis of long-term behavior () of a dynamic system

• Unlimited growth (unrealistic)• Limited dynamics - Fixed point / Some kind of equilibrium - periodic or quasi-periodic motion - chaotic motion (expansion and folding)

How stable is the dynamics? - when the control parameter changes - when disturbed (push to neighboring points in phase space)

Page 76: Lecture series: Data analysis

Stability of equilibrium pointsDynamical system described by time-dependent states

Suppose has an equilibrium .

• The equilibrium of the above system is Lyapunov stable, if, for every , there exists a such that if , then , for every .

• It is asymptotically stable, if it is Lyapunov stable and if there exists such that if , then .

• It is exponentially stable, if it is asymptotically stable and if there exists such that if , then, for every .

Page 77: Lecture series: Data analysis

Stability of equilibrium points

• Lyapunov stability: Tube of diameter Solutions starting "close enough" to the equilibrium (within a distance from it) remain "close enough" forever (within a distance from it). Must be true for any that one may want to choose.

• Asymptotic stability:Solutions that start close enough not only remain close enough but also eventually converge to the equilibrium.

• Exponential stability:Solutions not only converge, but in fact converge faster than or at least as fast as a particular known rate.

Page 78: Lecture series: Data analysis

Divergence and convergenceChaotic trajectories are Lyapunov-instable:

• Divergence:Neighboring trajectories expandSuch that their distance increasesexponentially (Expansion)

• Convergence:Expansion of trajectories to theattractor limits is followed by adecrease of distance (Folding).

Sensitive dependence on initial conditions

Quantification: Lyapunov-exponent

Page 79: Lecture series: Data analysis

Lyapunov-exponentCalculated via perturbation theory:

infintesimal perturbation in the initial conditions

Local linearization:

Solution:

𝐷 𝑓 (𝑥) - Jacobi-Matrix

Taylor series

𝜆 - Lyapunov exponent

Page 80: Lecture series: Data analysis

Lyapunov-exponentIn m-dimensional phase space:

Lyapunov-spectrum: , (expansion rates for different dimensions)

Relation to divergence:

Dissipative system:

Largest Lyapunov exponent (LLE) (often ):

Regular dynamics Chaotic dynamics Stochastic dynamics Stable fixed point

Page 81: Lecture series: Data analysis

Example: Logistic map

Bifurcation diagram

Fixed point

Period doubling

Chaos

Largest Lyapunov exponent

Dependence of the control parameter

Page 82: Lecture series: Data analysis

Lyapunov-exponent

- Dynamic characterization of attractors (Stability properties)- Classification of attractors via the signs of the Lyapunov- spectrum- Average loss of information regarding the initial conditions

Average prediction time:

( – localization precision of initial condition, j+ – index of last positive Lyapunov exponent)

Page 83: Lecture series: Data analysis

Largest Lyapunov-exponent: Estimation- Reference trajectory: - Neighboring trajectory: - Initial distance: - Distance after T time steps: - Expansion factor:- New neighboring trajectory to , to etc.- Calculate times:

Largest Lyapunov exponent (LLE):

𝑇

𝜆

ln𝛬

(𝑖)𝜆 (𝑇 )= 1

𝑇 ∑𝑖=1

𝑙

Λ (𝑖)

[Wolf et al. Determining Lyapunov exponents from a time series, Physica D 1985]

Page 84: Lecture series: Data analysis

Non-linear model systems

Linear measures

Introduction to non-linear dynamics

Non-linear measures

- Introduction to phase space reconstruction

- Lyapunov exponent

Today’s lecture

Page 85: Lecture series: Data analysis

Non-linear measures

- Dimension

- Entropies

- Determinism

- Tests for Non-linearity, Time series surrogates

Next lecture