The Role of Linear Algebra in EEG Analysis Robert Hergenroder II December 20, 2016
Abstract In this paper we are exploring the role of linear algebra in processing electroencephalography signals via two separate, but complementary, processes: Independent Component Analysis and Principle Component Analysis.
An Introduction to EEG technologies ◮ Electroencephalography, or EEG, measures electrical signals on the scalp. ◮ It is designed to record neuron activity. ◮ In comparison to other brain measurement devices, such as Magnetic Resonance Imaging, EEG technology allows for more precise measurements in regards to time (in the millisecond range.) ◮ Linear Algebra allows for configuring the data in an optimum manner.
Figure 1 Figure: Represented is the electrode placement and measurements of an EEG.
There are various algorithms for the processing of the raw data to look at differing aspects of modeling cognition as it relates to EEG. In particular we are going to be looking at Independent Component Analysis and Principle Component Analysis and how they work together to produce more easily read data.
Independent Component Analysis, or ICA ◮ ICA is composed of different techniques to process multivariate data. ◮ ICA is used to remove “noise,” skin galvanization, eye movement, etc, from raw data. ◮ ICA is able to identify independent sources within various signals. ◮ ICA includes techniques for finding: ◮ A , a co-efficient matrix ◮ � b , a noise vector ◮ � s , a source vector ◮ Which satisfies the following equation: s + � � x = A � b
Figure: The importance of ICA
Constructing a Linear System ◮ ICA allows us to look at the data in a linear way. ◮ Each measurement is an n -dimensional space, where n is the number of channels the EEG is gathering data from. ◮ There are t measurements, where t is a set of vectors associated with any particular time measurement in R n This is exampled where n = 3 in Figure 2, where each data point translates to a vector � x
Figure 2 x vector in R 3 . Figure: Each point represents a �
Our Data Matrix Each data point translates to an � x vector: ∈ R n � � � X = x 1 � x 2 ... � x t X is an n × t matrix where the rows are a given channel’s electrical output across time, and the columns are a single time “snapshot” of what every channel’s electrical charge is. ... x 11 x 12 x 1 t x 21 x 22 ... x 2 t X = ... ... ... ... x n 1 x n 2 ... x nt
An example matrix We shall define an example matrix as follows: 1 1 0 � � � X = x 1 x 2 � x 3 � = 2 2 1 1 0 1 Ergo channel one measured electrical signals of 1, 1, and 0, at t = 1, t = 2, and t = 3 respectively.
Decomposing our Data Matrix to a set of basis vectors These � x vectors can be further decomposed to a set of basic source vectors, � s , which are linearly independent. ∈ R n � � � x 1 ⇒ S = � � � s 1 s 2 ... s n ... ∈ R n � � � � x n ⇒ S = s 1 � s 2 ... � s n
The simplest source matrix These source vectors can represented most simplistically as the n × n identity matrix: 1 0 ... 0 0 1 ... 0 � � � S = = = I s 1 s 2 � ... s n � ... ... ... 0 0 0 ... 1 Although through ICA algorithms we are able to produce a more functional, and efficient, matrix of source data.
Defining a Coefficient Matrix The decomposition of input data to a basis vector allows us to define a coefficient, a, to each source vector � s which corresponds to the values of the data point vectors, � x . n � x = � a it � s i = S � a i =1 By collecting the vectors we are able to produce the equation form: X = SA X is our collection of data point vectors in an n × t matrix, S is a collection of decomposed basis vectors in an n × n matrix, and A is the collection of coefficient vectors in an n × t matrix.
Exampling a Coefficient Matrix In our example, we will be using our previously defined X matrix, and defining our source matrix as the identity matrix for ease of calculation. 1 1 0 0 1 = S � � x 1 = 2 a 1 = 0 1 0 2 1 0 0 1 1 1 1 0 0 1 = S � � x 2 = 2 a 2 = 0 1 0 2 0 0 0 1 0 0 1 0 0 0 = S � � x 3 = 1 a 3 = 0 1 0 1 1 0 0 1 1
Example Matrices And with our example matrix: 1 0 0 1 1 0 X = SA = 0 1 0 2 2 1 0 0 1 1 0 1 At this point data can undergo Principle Component Analysis to reduce the matrices ranks and make the processing more efficient.
Principle Component Analysis Principle Component Analysis, or PCA, is used to determine a more accurate matrix by distinguishing a more efficient matrix to express the source vectors and to identify noise vectors. This allows for reduction in dimensionality, making the data more concise. Our original data, � x vectors, are thought to be composed s , and a noise vector, � of two main portions: a source vector, � b . s + � � x = � b This is done by examining correlations between the components of our � x vectors to distinguish sources with the largest variance, which would denote unique signals. A co-variance matrix is mapped which relates the correlations between our � x channels.
Further delineations of PCA Noise and sources are arbitrarily defined. While ICA allows for each component to be distinguished, PCA maps channel correlations and is often utilized as a pre-processing step before ICA algorithms are ran. The first step in PCA of EEG data is to find a “covariance matrix.”
Finding a Co-variance Matrix Co-variance is defined as the expected change between two data points across time. This allows researchers to see the correlations between the data points. Correlation between data points is presumed to represent noise and redundancy. To begin finding a co-variance matrix it is assumed that the data is “zero mean,” or that the mean of each channel has been removed. Such data would fulfill the following equation: t 1 � [ X ] ij = 0 , where i = 1 , ..., n t j =1 Zeroing the mean has a number of benefits in data analysis, coefficients represent each data point more accurately as correlation is minimized, and allows for a superposition of data points which more acutely reflects their variance.
Zeroing the mean of our example Our example matrix therefore becomes: 3 1 [ X ] 1 t = 1 3(1 + 1 + 0) = 2 � x T � 1 − 2 1 − 2 0 − 2 � 3 ⇒ � 1 = = 3 3 3 3 t =1 � 1 1 − 2 � 3 3 3 3 1 [ X ] 2 t = 1 3(2 + 2 + 1) = 5 � x T � 2 − 5 2 − 5 1 − 5 � 2 = = 3 ⇒ � 3 3 3 3 t =1 � 1 1 − 2 � 3 3 3 3 1 [ X ] 3 t = 1 3(1 + 0 + 1) = 2 � x T 1 − 2 0 − 2 1 − 2 � � 3 ⇒ � 3 = = 3 3 3 3 t =1 � 1 − 2 1 � 3 3 3
Our new zero-mean matrix 1 1 − 2 3 3 3 1 1 − 2 X = 3 3 3 1 − 2 1 3 3 3
Defining a covariance Matrix The co-variance matrix itself is defined by the following equation: t Σ = 1 T = 1 � t XX T x i � � x i t j =1 When Σ ij = 0 The channels � x i and � x j are entirely uncorrelated.
Our example covariance matrix Our example co-variance matrix would be computed as follows: 1 1 − 2 1 1 1 3 3 3 3 3 3 Σ = 1 1 1 − 2 1 1 − 2 3 3 3 3 3 3 3 1 − 2 1 − 2 − 2 1 3 3 3 3 3 3 2 2 − 1 3 3 3 Σ = 1 2 2 − 1 3 3 3 3 − 1 − 1 2 3 3 3 2 2 − 1 9 9 9 2 2 − 1 Σ = 9 9 9 − 1 − 1 2 9 9 9 Ergo in our example all the channels are correlated in some manner.
Decomposing the matrix to its eigensystem By diagonalizing the co-variance matrix we are able to minimize redundancy and maximize the interesting dynamics. Since the interesting dynamics we are searching for is typically limited, this can allow for a reduction in the dimensionality of the matrix. To begin, we find the eigenvalues, λ , and eigenvectors, � v , of Σ : n � v T = VΛV T Σ = λ i � v i � i i =1
Our examples eigensystem And with our example Σ : Σ = √ √ √ 1 1 1 2 ( − 1 − 3) 2 ( − 1 + 3) − 1 9 (3 + 3) 0 0 √ √ √ 1 1 1 2 ( − 1 − 3) 2 ( − 1 + 3) 1 0 9 (3 − 3) 0 ∗ 1 1 0 0 0 0 √ √ 1 1 2 ( − 1 − 3) 2 ( − 1 − 3) 1 √ √ 1 1 2 ( − 1 + 3) 2 ( − 1 + 3) 1 − 1 1 0
Decomposition allows for a reduction in rank Σ is only full rank if and only if all of the eigenvalues are positive. If some of the eigenvalues are equal to zero, we are able to reduce the rank of the matrix to r , or the number of non-zero eigenvalues. r � � x = a i � � v i = S � a i =1 Typically this reduction makes processing more efficient and quicker, without any loss of potentially important data. The vectors are collected to the familiar form: X = SA Where X is our n × t data matrix, S is our n × r matrix of relevant, e.g. non-zero, eigenvectors, and A is our r × t co-efficient matrix, which points to our � x vectors locations in our reduced r -dimensional space.
Recommend
More recommend