Gaussian Observation HMM for EEG

  • Upload
    deetov

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

  • 8/10/2019 Gaussian Observation HMM for EEG

    1/9

    G a u s s i a n O b s e r v a t i o n H i d d e n M a r k o v m o d e l s f o r

    E E G a n a l y s i s

    W i l l i a m D . P e n n y a n d S t e p h e n J . R o b e r t s

    T e c h n i c a l R e p o r t ,

    N e u r a l S y s t e m s R e s e a r c h G r o u p ,

    D e p a r t m e n t o f E l e c t r i c a l a n d E l e c t r o n i c E n g i n e e r i n g ,

    I m p e r i a l C o l l e g e o f S c i e n c e , T e c h n o l o g y a n d M e d i c i n e ,

    L o n d o n S W 7 2 B T . , U . K .

    w . p e n n y @ i c . a c . u k , s . j . r o b e r t s @ i c . a c . u k

    O c t o b e r 5 , 1 9 9 8

    A b s t r a c t

    W e s h o w , u s i n g a n u m b e r o f s y n t h e t i c d a t a s e t s , t h a t H M M s c a n d e t e c t t h e c h a n g e s

    i n D C l e v e l s , c o r r e l a t i o n , f r e q u e n c y a n d c o h e r e n c e t h a t a r e t y p i c a l o f t h e n o n s t a t i o n a r y

    c h a n g e s i n a n E E G s i g n a l . W e a l s o s h o w t h a t t h e n u m b e r o f h i d d e n s t a t e s i n a n H M M

    c a n b e c h o s e n u s i n g a c l u s t e r a n a l y s i s o f d e r i v e d f e a t u r e s . O u r e x p e r i m e n t s a r e b a s e d o n

    t h e u s e o f H M M s w i t h G a u s s i a n o b s e r v a t i o n d e n s i t i e s t r a i n e d o n a u t o r e g r e s s i v e ( A R )

    o r m u l t i v a r i a t e a u t o r e g r e s s i v e ( M A R ) c o e c i e n t s . T h e e x t r a c t i o n o f t h e s e c o e c i e n t s

    r e q u i r e s t h a t t h e s i g n a l b e w i n d o w e d a n d t h e c o e c i e n t s c a l c u l a t e d f o r e a c h w i n d o w .

    T h e w i n d o w i n g p r o c e d u r e i s , h o w e v e r , f u n d a m e n t a l l y a w e d s o m e w i n d o w s c o n t a i n

    i n f o r m a t i o n f r o m m o r e t h a n o n e s t a t e a n d s o c a n l e a d t o a l a r g e r n u m b e r o f i n f e r r e d

    s t a t e s t h a n i s n e c e s s a r y a n d t o i n c o r r e c t e s t i m a t e s o f s t a t e a n d s t a t e t r a n s i t i o n s .

    1 I n t r o d u c t i o n

    I n a r e v i e w o f s p a t i a l p a t t e r n r e c o g n i t i o n m e t h o d s f o r E E G a n a l y s i s , N u n e z 2 ] s t r e s s e s t h e

    n e e d t o d e a l w i t h n o n - s t a t i o n a r y a n d n o n - l o c a l i z e d s o u r c e s o f i n f o r m a t i o n . I n t h i s b r i e f

    r e p o r t w e s h o w t h a t H i d d e n M a r k o v M o d e l s ( H M M s ) t e x a c t l y t h i s r e q u i r e m e n t t h e y a r e

    t h e p e r f e c t m o d e l f o r E E G a n a l y s i s . I n t h e H M M , t h e r e a n u m b e r o f u n d e r l y i n g s t a t e s e a c h

    o f w h i c h i s a s s o c i a t e d w i t h s t a t i o n a r y d y n a m i c s . T h e m o d e l s a s s o c i a t e d w i t h e a c h s t a t e

    m a y b e m u l t i v a r i a t e a n d r e l y o n s o m e l o c a l o r d i s t r i b u t e d s u b s e t o f e l e c t r o d e s . T r a n s i t i o n s

    b e t w e e n s t a t e s a l l o w f o r t r a c k i n g o f n o n s t a t i o n a r y d y n a m i c s .

    I n t h i s r e p o r t , w e f o c u s o n H M M s w i t h G a u s s i a n o b s e r v a t i o n d e n s i t i e s . T h e H M M s a r e

    t r a i n e d u s i n g t h e E M a l g o r i t h m a n d t h e m o s t l i k e l y s t a t e s e q u e n c e s a r e i d e n t i e d u s i n g

    s i n g l e - s t a t e o r V i t e r b i d e c o d i n g . F u l l d e t a i l s o f t h e a l g o r i t h m s a r e a v a i l a b l e i n t h e t u t o r i a l

    b y R a b i n e r 5 ] .

    T h e H M M c a n b e a p p l i e d e i t h e r t o t h e o r i g i n a l e l e c t r o d e r e c o r d i n g s o r t o a t i m e - s e r i e s

    o f a u t o r e g r e s s i v e ( A R ) o r m u l t i v a r i a t e a u t o r e g r e s s i v e ( M A R ) c o e c i e n t s d e r i v e d f r o m t h e

    o r i g i n a l d a t a ( s e e A p p e n d i c e s A a n d B f o r d e t a i l s ) . I n t h i s s h o r t t e c h n i c a l n o t e , w e d e m o n -

    s t r a t e a f e w p r o p e r t i e s o f t h e H M M ( o n s y n t h e t i c d a t a ) w h i c h m a k e i t p a r t i c u l a r l y s u i t a b l e

    f o r E E G a n a l y s i s .

    1

  • 8/10/2019 Gaussian Observation HMM for EEG

    2/9

    0 10 20 30 40 50 600.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    F i g u r e 1 : D C c h a n g e s . H M M w i t h t w o s t a t e s , o n e - d i m e n s i o n a l o b s e r v a t i o n s , d i e r e n t

    m e a n s , c o m m o n v a r i a n c e s . T h e s o l i d l i n e s h o w s t h e o r i g i n a l t i m e s e r i e s . T h e d o t t e d l i n e

    s h o w s t h e m e a n o f t h e G a u s s i a n d i s t r i b u t i o n a s s o c i a t e d w i t h t h e H M M s t a t e c h o s e n b y

    V i t e r b i d e c o d i n g .

    2 D C c h a n g e s

    F i g u r e 1 s h o w s a t i m e s e r i e s g e n e r a t e d f r o m a n H M M w i t h t w o h i d d e n s t a t e s w i t h m e a n s

    = 0 5 1 5 ] . T h e v a r i a n c e s w e r e C o v = 0 0 2 0 0 2 ] . T h e h i d d e n s t a t e s e q u e n c e i s s t a t e 1

    f o r 2 0 s t e p s , s t a t e 2 f o r 2 0 s t e p s t h e n s t a t e 1 a g a i n f o r t h e n a l 2 0 s t e p s . G i v e n t h e s e s t a t e

    d u r a t i o n s i t i s p o s s i b l e t o c a l c u l a t e t h e o p t i m a l d i a g o n a l e l e m e n t s i n t h e s t a t e t r a n s i t i o n

    m a t r i x 5 ] a n d a s w e h a v e o n l y a 2 b y 2 m a t r i x , t h e o d i a g o n a l e l e m e n t s a r e a l s o c a l c u l a b l e

    g i v i n g A = 0 9 5 0 0 5 0 0 5 0 9 5 ] .

    A n H M M w a s t r a i n e d o n t h e t i m e s e r i e s ( t h e o b s e r v a t i o n m o d e l w a s c o n s t r a i n e d s u c h

    t h a t t h e ( c o ) v a r i a n c e s w e r e t h e s a m e f o r a l l s t a t e s ) . T h e l e a r n e d p a r a m e t e r s w e r e

    ^

    =

    1 0 ,

    ^

    A = 0 9 7 0 0 3 0 0 5 0 9 5 ] ,

    ^

    = 0 5 2 1 5 2 ] a n d

    ^

    C o v = 0 0 2 0 0 2 ] . V i t e r b i d e c o d i n g

    i d e n t i e d t h e c o r r e c t h i d d e n s t a t e s e q u e n c e .

    3 C o r r e l a t i o n c h a n g e s

    T w o - d i m e n s i o n a l d a t a w a s g e n e r a t e d f r o m a 2 - c o m p o n e n t G a u s s i a n M i x t u r e M o d e l ( G M M )

    a s s h o w n i n F i g u r e 2 a . T h e r s t c o m p o n e n t w a s s p h e r i c a l ( i e . t h e v a r i a b l e s w e r e u n c o r -

    r e l a t e d ) a n d t h e s e c o n d c o m p o n e n t w a s e l l i p t i c a l . T h e d a t a w a s t h e n o r d e r e d s u c h t h a t

    w e g e t 2 0 0 p o i n t s f r o m c o m p o n e n t ( i ) , 2 0 0 f r o m c o m p o n e n t ( i i ) a n d t h e n 2 0 0 f r o m c o m -

    p o n e n t ( i ) a g a i n . T h i s i s s h o w n i n F i g u r e 2 b . T h e t i m e s e r i e s a r e u n c o r r e l a t e d e x c e p t i n

    t h e m i d d l e p o r t i o n . T h e m o d e l p a r a m e t e r s a r e = 1 0 , A = 0 9 9 5 0 0 0 5 0 0 0 5 0 9 9 5 ]

    ( i d e a l t r a n s i t i o n m a t r i x c a l c u l a t e d f r o m s t a t e d u r a t i o n s ) ,

    1

    = 1 1 0 ] a n d

    2

    = 1 1 0 ] a n d

    C o v

    1

    = 1 0 0 1 ] a n d C o v

    2

    = 1 0 9 0 9 1

    A s e c o n d G M M w a s t h e n t r a i n e d o n t h e d a t a . T h e l e a r n e d m e a n a n d c o v a r i a n c e p a r a m -

    e t e r s w e r e

    ^

    1

    = 0 9 5 9 8 0 ] a n d

    ^

    2

    = 1 0 7 1 0 1 2 ] a n d

    ^

    C o v

    1

    = 0 7 9 4 ; 0 0 4 ; 0 0 4 0 7 4 1 ]

    a n d

    ^

    C o v

    2

    = 1 4 3 1 2 8 1 2 8 1 3 5 ] . T h e c l a s s i c a t i o n e r r o r r a t e w a s 2 6 . 0 0 p e r c e n t . T h i s

    i s ' n t g r e a t a s 2 / 3 o f t h e d a t a a r e f r o m c l a s s / s t a t e 1 t h e n a l w a y s g u e s s i n g c l a s s 1 w o u l d g i v e

    a n e r r o r o f 3 3 . 0 0 p e r c e n t .

    A n H M M w a s t h e n s e e d e d w i t h t h e m e a n a n d c o v a r i a n c e v a l u e s o b t a i n e d f r o m t h e G M M

    a n d t r a i n e d w i t h t h e E M a l g o r i t h m t o n e - t u n e t h e m e a n s a n d c o v a r i a n c e s a n d t o e s t i m a t e

    t h e i n i t i a l s t a t e d i s t r i b u t i o n a n d s t a t e t r a n s i t i o n p r o b a b i l i t i e s . T h e l e a r n e d p a r a m e t e r s w e r e

    ^

    = 0 0 0 1 0 9 9 9 ] ,

    ^

    A = 0 9 9 5 0 0 0 5 0 0 2 1 0 9 7 9 ] ,

    ^

    1

    = 0 9 8 9 8 4 ] a n d

    ^

    2

    = 0 9 9 8 1 0 0 2

    2

  • 8/10/2019 Gaussian Observation HMM for EEG

    3/9

    ( a )

    4 2 0 2 4 67

    8

    9

    10

    11

    12

    13

    14

    ( b )

    0 50 100 150 200 250 3004

    2

    0

    2

    4

    6

    8

    10

    12

    14

    ( c )

    0 50 100 150 200 250 3000

    0.5

    1

    1.5

    2

    2.5

    3

    ( d )

    0 50 100 150 200 250 3000

    0.5

    1

    1.5

    2

    2.5

    3

    F i g u r e 2 : C o r r e l a t i o n c h a n g e s . H M M w i t h t w o s t a t e s , t w o - d i m e n s i o n a l o b s e r v a t i o n s ,

    s a m e m e a n s , d i e r e n t c o v a r i a n c e s : ( a ) d a t a a s g e n e r a t e d b y a G M M w i t h a m i x t u r e o f ( i )

    a n u n c o r r e l a t e d G a u s s i a n a n d ( i i ) a c o r r e l a t e d G a u s s i a n ( b ) t h e d a t a i n p l o t a h a s b e e n

    o r d e r e d s u c h t h a t w e g e t 1 0 0 p o i n t s f r o m c o m p o n e n t ( i ) , 1 0 0 f r o m c o m p o n e n t ( i i ) a n d t h e n

    1 0 0 f r o m c o m p o n e n t ( i ) a g a i n . T h e t i m e s e r i e s a r e u n c o r r e l a t e d a t t h e b e g i n n i n g a n d e n d

    b u t a r e c o r r e l a t e d i n t h e m i d d l e , ( c ) c l a s s i c a t i o n s f r o m a G a u s s i a n M i x t u r e M o d e l , ( d )

    c l a s s i c a t i o n s f r o m a n H M M .

    a n d

    ^

    C o v

    1

    = 0 8 3 1 ; 0 0 1 3 ; 0 0 1 3 0 8 2 2 ] a n d

    ^

    C o v

    2

    = 0 8 3 1 ; 0 0 1 3 ; 0 0 1 3 0 8 2 2 ] . S i n g l e -

    s t a t e d e c o d i n g t h e n i d e n t i e d t h e h i d d e n s t a t e s e q u e n c e w i t h a n e r r o r o f 1 . 0 0 p e r c e n t ( 3

    e r r o r s o u t o f 3 0 0 ) . V i t e r b i d e c o d i n g r e d u c e d t h i s t o 0 . 6 6 7 p e r c e n t ( 2 o u t o f 3 0 0 ) .

    T h e G M M m a k e s a c l a s s i c a t i o n a t e a c h t i m e s t e p u s i n g t h e c u r r e n t o b s e r v a t i o n o n l y

    w h e r e a s t h e H M M u s e s a l l o b s e r v a t i o n s t o m a k e e a c h c l a s s i c a t i o n . E e c t i v e l y , t h e G M M

    t r i e s t o d i s c r i m i n a t e b e t w e e n d i s t r i b u t i o n s b a s e d o n a s i n g l e d a t a p o i n t w h e r e a s t h e H M M

    i s u s i n g

    d

    j

    = 1 0 0 d a t a p o i n t s , w h e r e

    d

    j

    i s t h e a v e r a g e s t a t e d u r a t i o n d e n s i t y . T h i s i s w h y

    t h e H M M d o e s s o m u c h b e t t e r a t r e c o g n i s i n g t h e h i d d e n s t a t e s .

    4 F r e q u e n c y c h a n g e s

    F i g u r e 3 s h o w s n i n e s e c o n d s o f a t i m e s e r i e s g e n e r a t e d f r o m a n H M M w i t h t w o h i d d e n s t a t e s

    w h e r e t h e o b s e r v a t i o n s w e r e g e n e r a t e d u s i n g a u t o r e g r e s s i v e ( A R ) m o d e l s ( s e e A p p e n d i x A )

    o f o r d e r p = 4 . T h e r e a r e 1 2 8 s a m p l e s p e r s e c o n d . T h e c o e c i e n t s o f t h e t w o m o d e l s w e r e

    a

    1

    = ; 0 3 7 0 4 ; 0 1 7 4 0 0 2 2 2 0 0 3 1 8 9 ] a n d a

    2

    = ; 0 0 2 7 5 0 0 0 9 7 0 0 3 7 7 ; 0 0 4 4 3 ] . T h e s e

    c o r r e s p o n d t o ( i ) a 1 0 - H z s i n u s o i d h i d d e n i n G a u s s i a n n o i s e , a n d ( i i ) j u s t G a u s s i a n n o i s e .

    T h e h i d d e n s t a t e s e q u e n c e i s s t a t e 2 f o r 3 s e c o n d s , s t a t e 1 f o r 3 s e c o n d s t h e n s t a t e 2 a g a i n

    f o r t h e n a l 3 s e c o n d s .

    3

  • 8/10/2019 Gaussian Observation HMM for EEG

    4/9

    ( a )

    0 1 2 3 4 5 6 7 8 94

    3

    2

    1

    0

    1

    2

    3

    4

    ( b )

    0 1 2 3 4 5 6 7 8 90

    0.5

    1

    1.5

    2

    2.5

    3

    F i g u r e 3 : F r e q u e n c y c h a n g e s . H M M w i t h t w o s t a t e s , o n e - d i m e n s i o n a l o b s e r v a t i o n s . T h e

    t w o s t a t e s u s e d i e r e n t A R m o d e l s c o r r e s p o n d i n g t o ( i ) a 1 0 - H z s i n u s o i d h i d d e n i n G a u s s i a n

    n o i s e , a n d ( i i ) j u s t G a u s s i a n n o i s e : ( a ) o r i g i n a l t i m e s e r i e s , ( b ) c l a s s i c a t i o n b y H M M .

    T h e o b s e r v e d t i m e s e r i e s w a s t h e n s p l i t u p i n t o o v e r l a p p i n g t w o - s e c o n d b l o c k s w i t h

    a n o s e t o f 0 . 2 s e c o n d s b e t w e e n b l o c k s . W i t h i n e a c h o f t h e s e b l o c k s a n A R ( 4 ) m o d e l w a s

    t r a i n e d . T h i s g e n e r a t e d a s e r i e s o f 4 6 4 - d i m e n s i o n a l f e a t u r e s o n w h i c h a n H M M w a s t r a i n e d .

    T h e l e a r n e d p a r a m e t e r s w e r e

    ^

    = 0 1 ,

    ^

    A = 0 9 4 1 0 0 5 9 0 0 3 6 0 9 6 4 ] , a

    1

    = ; 0 3 5 6

    ; 0 0 3 5 0 2 8 7 0 3 0 9 ] a n d a

    2

    = ; 0 0 5 4 0 0 1 3 0 0 6 2 ; 0 0 5 6 ] . V i t e r b i d e c o d i n g i d e n t i e d t h e

    c o r r e c t h i d d e n s t a t e s e q u e n c e t o w i t h i n t h e q u a n t i s a t i o n e r r o r i n t r o d u c e d b y s p l i t t i n g u p

    t h e d a t a i n t o b l o c k s .

    A n u n d e s i r a b l e a s p e c t o f t h i s e x a m p l e i s t h a t t h e t i m e s e r i e s h a d t o b e c h o p p e d u p i n t o

    d i s c r e t e , o v e r l a p p i n g b l o c k s . T h i s i n v o l v e d t h e a d h o c c h o i c e o f b l o c k s i z e a n d b l o c k o s e t

    p a r a m e t e r s . A d e s i r a b l e a s p e c t o f c h o p p i n g u p t h e s i g n a l i n t o d i s c r e t e b l o c k s a n d d e r i v i n g

    f e a t u r e s f r o m t h o s e b l o c k s i s t h a t w e h a v e d r a s t i c a l l y r e d u c e d t h e d i m e n s i o n a l i t y o f t h e

    s p a c e t h a t t h e H M M o p e r a t e s i n . I n t h i s e x a m p l e w e h a v e r e d u c e d a t i m e s e r i e s c o n t a i n i n g

    ( 9 s e c o n d s t i m e s 1 2 8 s a m p l e s p e r s e c o n d ) 1 1 5 2 s a m p l e s i n t o a f e a t u r e v e c t o r c o n t a i n i n g 4 6

    i t e m s . T h i s r e d u c e s t h e c o m p u t u t i o n b y a f a c t o r o f 2 5 .

    5 C o h e r e n c e c h a n g e s

    F i g u r e 4 s h o w s a f o u r s e c o n d e x c e r p t f r o m a 1 5 - s e c o n d t i m e s e r i e s w h i c h i s s a m p l e d a t a

    r a t e o f 1 2 8 s a m p l e s p e r s e c o n d . T h e r s t a n d l a s t v e s e c o n d s w e r e g e n e r a t e d f r o m t w o

    c o h e r e n t 1 0 - H z s i n u s o i d s a n d t h e m i d d l e v e s e c o n d s w e r e g e n e r a t e d b y t w o i n c o h e r e n t 1 0 -

    H z s i n u s o i d s . A l l d a t a w a s c o r r u p t e d b y a d d i t i v e G a u s s i a n n o i s e . T h e c o h e r e r e n c e t i m e f o r

    t h e i n c o h e r e n t s e c t i o n w a s 1 s e c o n d , t h a t i s , a f t e r 1 s e c o n d t h e p h a s e o f o n e o f t h e s i g n a l s

    c h a n g e d r a n d o m l y w i t h r e s p e c t t o t h e o t h e r s i g n a l . T h i s l o n g c o h e r e n c e t i m e w a s c h o s e n

    s u c h t h a t t h e r e w a s n o s i g n i c a n t c h a n g e i n t h e s p e c t r a l d e n s i t y o f e a c h s i g n a l - t h u s t h e

    o n l y w a y t o t e l l t h e s i g n a l s a p a r t i s b y l o o k i n g a t t h e c o h e r e n c y .

    T h e o b s e r v e d t i m e s e r i e s w a s t h e n s p l i t u p i n t o o v e r l a p p i n g t w o - s e c o n d b l o c k s w i t h a n

    o s e t o f 0 . 2 s e c o n d s b e t w e e n b l o c k s . W i t h i n e a c h o f t h e s e b l o c k s a m u l t i v a r i a t e a u t o r e g r e s -

    s i v e M A R m o d e l ( s e e A p p e n d i x B ) w a s t r a i n e d , w i t h a m o d e l o r d e r o f p = 4 . T h i s g e n e r a t e d

    a s e r i e s o f 4 6 1 6 - d i m e n s i o n a l ( t h e d i m e n s i o n o f t h e M A R m o d e l i s p x d x d w h e r e d = 2 i s

    t h e d i m e n s i o n o f t h e t i m e s e r i e s , a n d p = 4 - s e e A p p e n d i x B ) f e a t u r e s o n w h i c h a G a u s s i a n

    o b s e r v a t i o n H M M w a s t r a i n e d .

    T h e e s t i m a t e d m e a n s o f t h e G a u s s i a n s i n e a c h o f t h e s t a t e s c o r r e s p o n d t o a n M A R m o d e l

    f o r t h a t s t a t e . F r o m t h e M A R c o e c i e n t s i t i s p o s s i b l e t o r e c o n s t r u c t t h e s p e c t r a l d e n s i t i e s

    a n d t h e c r o s s - s p e c t r a l d e n s i t y ( s e e A p p e n d i x B ) . F i g u r e 5 s h o w s t h e e s t i m a t e d c o h e r e n c y

    4

  • 8/10/2019 Gaussian Observation HMM for EEG

    5/9

    ( a )

    3 3.5 4 4.5 5 5.5 6 6.5 72

    1

    0

    1

    2

    3

    4

    5

    6

    7

    ( b )

    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150

    0.5

    1

    1.5

    2

    2.5

    3

    F i g u r e 4 : C o h e r e n c e c h a n g e s . H M M w i t h t w o s t a t e s , t w o - d i m e n s i o n a l o b s e r v a t i o n s . T h e

    t w o s t a t e s u s e d i e r e n t M A R m o d e l s c o r r e s p o n d i n g t o ( i ) t w o c o h e r e n t 1 0 - H z s i n u s o i d s w i t h

    a d d e d G a u s s i a n n o i s e , a n d ( i i ) t w o i n c o h e r e n t 1 0 - H z s i n u s o i d s w i t h a d d e d G a u s s i a n n o i s e :

    ( a ) e x c e r p t o f o r i g i n a l t i m e s e r i e s , ( b ) c l a s s i c a t i o n b y H M M .

    ( a )

    0 10 20 30 40 50 60 700

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    ( b )

    0 10 20 30 40 50 60 700

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    F i g u r e 5 : C o h e r e n c e p l o t s : s o l i d l i n e s f o r t r u e ( s a m p l e ) c o h e r e n c e v a l u e s , d o t t e d l i n e s f o r

    c o h e r e n c e v a l u e s a s e s t i m a t e d b y t h e H M M f o r ( a ) s t a t e 1 , ( b ) s t a t e 2 .

    i n e a c h s t a t e , a s c a l c u l a t e d f r o m t h e M A R c o e c i e n t s a s s o c i a t e d w i t h e a c h h i d d e n s t a t e .

    T h i s c l e a r l y s h o w s t h a t , i n s t a t e 1 , t h e s i g n a l s a r e r e c o g n i s e d a s c o h e r e n t a t 1 0 H z w h i l e

    i n s t a t e 2 t h e s i g n a l s a r e r e c o g n i s e d a s i n c o h e r e n t . T h e s p e c t r a l d e n s i t i e s o f e a c h s i g n a l c a n

    a l s o b e a c c u r a t e l y e s t i m a t e d i n t h i s w a y . T h i s p r o v i d e s a m e a n i n g f u l i n t e r p r e t a t i o n o f t h e

    o t h e r w i s e o p a q u e 1 6 - d i m e n s i o n a l p a r a m e t e r v e c t o r a s s o c i a t e d w i t h e a c h h i d d e n s t a t e .

    6 E E G - l i k e d a t a

    I n t h i s s e c t i o n , w e d e s c r i b e a s i m p l e m o d e l w h i c h c a p t u r e s s o m e a s p e c t s o f t h e s p o n t a n e o u s

    E E G s i g n a l . W e t h e n g e n e r a t e d a t a f r o m t h e m o d e l a n d i n f e r a G a u s s i a n o b s e r v a t i o n H M M

    f r o m t h e o b s e r v e d d a t a a l o n e . U n l i k e p r e v i o u s e x a m p l e s , w e w i l l a l s o i n f e r t h e n u m b e r o f

    s t a t e s i n t h e H M M .

    T h e s p o n t a n e o u s E E G m o d e l i s i t s e l f a t h r e e s t a t e H M M . F o r e a c h s t a t e , h o w e v e r , d a t a

    i s n o t g e n e r a t e d b y a G a u s s i a n b u t a c c o r d i n g t o

    y

    t

    = a

    1

    s i n ( 2 f

    1

    t ) + a

    2

    s i n ( 2 f

    2

    t ) + e

    t

    ( 1 )

    w h e r e e

    t

    i s z e r o m e a n I I D G a u s s i a n n o i s e w i t h s t a n d a r d d e v i a t i o n 0 . 3 . T h e t w o f r e q u e n -

    c i e s , f

    1

    a n d f

    2

    , w e r e c h o s e n t o b e 1 0 H z a n d 2 5 H z a s t h e y c o r r e s p o n d t o t h e f r e q u e n c i e s o f

    5

  • 8/10/2019 Gaussian Observation HMM for EEG

    6/9

    t h e E E G a l p h a ( o r m u ) a n d b e t a r h y t h m s . T h e w e i g h t i n g c o e c i e n t s w e r e s e t d i e r e n t l y

    f o r e a c h s t a t e . F o r s t a t e 1 w e h a v e a

    1

    = 0 , a

    2

    = 1 , f o r s t a t e 2 w e h a v e a

    1

    = 0 5 , a

    2

    = 0 5

    a n d f o r s t a t e 3 w e h a v e a

    1

    = 1 , a

    2

    = 0 . T h a t i s , s t a t e 1 i s p u r e b e t a r h y t h m , s t a t e 3 i s p u r e

    a l p h a r h y t h m a n d s t a t e 2 i s a m i x t u r e o f b o t h . T h e i n i t i a l s t a t e i s s t a t e 1 a n d t h e s t a t e

    t r a n s i t i o n m a t r i x i s

    P =

    0

    B

    @

    0 8 0 2 0 0

    0 0 0 8 0 2

    0 2 0 0 0 8

    1

    C

    A

    ( 2 )

    T h e d i a g o n a l e l e m e n t s w e r e c h o s e n s u c h t h a t t h e a v e r a g e s t a t e d u r a t i o n d e n s i t y w a s h a l f

    a s e c o n d ( t h i s h a s b e e n o b s e r v e d o n r e a l E E G d a t a 3 ] ) . T h e o - d i a g o n a l e l e m e n t s w e r e

    c h o s e n a r b i t r a r i l y ( t h e r e i s n o s i g n i c a n c e i n t h e f a c t t h a t w e h a v e a c y c l e o f t r a n s i t i o n s ) .

    F i g u r e 6 s h o w s f o r t y s e c o n d s o f d a t a g e n e r a t e d f r o m t h e m o d e l a l o n g w i t h a s s o c i a t e d

    h i d d e n s t a t e v a r i a b l e s . T h i s d a t a w a s t h e n s p l i t u p i n t o o v e r l a p p i n g h a l f s e c o n d b l o c k s

    w i t h a n o s e t o f 0 . 1 s e c o n d s b e t w e e n b l o c k s . W i t h i n e a c h o f t h e s e b l o c k s a n A R ( 8 ) m o d e l

    w a s t r a i n e d . T h i s g e n e r a t e d a s e r i e s o f 3 8 5 8 - d i m e n s i o n a l f e a t u r e s o n w h i c h a G a u s s i a n

    o b s e r v a t i o n H M M w a s t r a i n e d .

    F i g u r e 7 a s h o w s a p l o t o f t h e A R ( 8 ) c o e c i e n t s p r o j e c t e d o n t o t h e i r r s t t w o p r i n c i p a l

    c o m p o n e n t s . T o i d e n t i f y t h e ( a s s u m e d u n k n o w n ) r e q u i r e d n u m b e r o f H M M s t a t e s a G a u s -

    s i a n M i x t u r e M o d e l w i t h f u l l c o v a r i a n c e m a t r i c e s a n d k c o m p o n e n t s w a s t r a i n e d o n t h e

    A R ( 8 ) d a t a . F i g u r e 7 b s h o w s o f p l o t o f d e s c r i p t i o n l e n g t h v e r s u s k . T h e m o d e l w i t h t h e

    m i n i m u m d e s c r i p t i o n l e n g t h h a d 3 G a u s s i a n s . T h e s p e c t r a o f t h e A R m o d e l s c o r r e s p o n d i n g

    t o e a c h o f t h e s e c e n t r e s i s s h o w n i n F i g u r e 8 . T h i s G M M w a s t h e n u s e t o i n i t i a l i s e t h e

    H M M .

    T h e p a r a m e t e r s o f t h e H M M w e r e t h e n i n f e r r e d u s i n g t h e B a u m - W e l c h a l g o r i t h m . T h e

    r e s u l t i n g s p e c t r a c h a n g e d l i t t l e f r o m t h e s p e c t r a s h o w n i n F i g u r e 8 . T h e i n i t i a l s t a t e w a s

    i n f e r r e d , m i s t a k e n l y , t o b e s t a t e 3 . T h i s i s a c o n s e q u e n c e o f w i n d o w i n g t h e d a t a i n t h e r s t

    w i n d o w , m o s t o f t h e d a t a d e r i v e s f r o m s t a t e 3 ( s e e F i g u r e 6 ) . T h e i n f e r r e d s t a t e t r a n s i t i o n

    m a t r i x w a s

    ^

    P =

    0

    B

    @

    0 7 9 0 2 1 0 0 0

    0 0 7 0 8 5 0 0 8

    0 0 0 0 1 5 0 8 5

    1

    C

    A

    ( 3 )

    W e h a v e m i s t a k e n l y i n f e r r e d t h a t s t a t e 2 ( n o t s t a t e 1 ) i s t h e m o s t l i k e l y s u c c e s s o r o f

    s t a t e 3 . T h i s i s , a g a i n , a c o n s e q u e n c e o f w i n d o w i n g t h e d a t a . A n y t r a n s i t i o n i n t h e o r i g i n a l

    t i m e s e r i e s f r o m s t a t e 3 ( p u r e a l p h a ) t o s t a t e 1 ( p u r e b e t a ) w i l l , i n t h e w i n d o w e d t i m e s e r i e s ,

    l o o k l i k e a t r a n s i t i o n f r o m s t a t e 3 t o s t a t e 2 ( t r a n s i t i o n a l w i n d o w s w i l l c o n t a i n b o t h 1 0 H z

    a n d 2 5 H z d a t a ) a n d t h e n t o s t a t e 1 . T h i s e x p l a i n s t h e m i s t a k e n l y i n f e r r e d v a l u e s i n

    ^

    P

    7 D i s c u s s i o n

    W e h a v e s h o w n , u s i n g s y n t h e t i c d a t a , t h a t H M M s c a n d e t e c t t h e c h a n g e s i n D C l e v e l s ,

    c o r r e l a t i o n , f r e q u e n c y a n d c o h e r e n c e t h a t a r e t y p i c a l o f t h e n o n s t a t i o n a r i t i e s i n a n E E G

    s i g n a l . W e h a v e a l s o s h o w n t h a t t h e n u m b e r o f h i d d e n s t a t e s i n a n H M M c a n b e c h o s e n

    u s i n g a c l u s t e r a n a l y s i s o f d e r i v e d f e a t u r e s .

    A l l o f o u r e x p e r i m e n t s h a v e b e e n b a s e d o n t h e u s e o f H M M s w i t h G a u s s i a n o b s e r v a t i o n

    d e n s i t i e s t r a i n e d o n A R o r M A R c o e c i e n t s . T h e e x t r a c t i o n o f t h e s e c o e c i e n t s r e q u i r e s

    t h a t t h e s i g n a l b e w i n d o w e d a n d t h e c o e c i e n t s c a l c u l a t e d f o r e a c h w i n d o w . T h e w i n d o w i n g

    p r o c e d u r e i s , h o w e v e r , f u n d a m e n t a l l y a w e d s o m e w i n d o w s c o n t a i n i n f o r m a t i o n f r o m m o r e

    6

  • 8/10/2019 Gaussian Observation HMM for EEG

    7/9

    0 1 2 3 4 5 6 7 8 9 100

    2

    4

    6

    8

    10 11 12 13 14 15 16 17 18 19 200

    2

    4

    6

    8

    20 21 22 23 24 25 26 27 28 29 300

    2

    4

    6

    8

    30 31 32 33 34 35 36 37 38 39 400

    2

    4

    6

    8

    F i g u r e 6 : E E G - l i k e d a t a g e n e r a t e d f r o m 3 - s t a t e H M M . T h e s o l i d s t a i r c a s e p l o t s s h o w t h e

    H M M s t a t e . T h e d o t t e d s t a i r c a s e p l o t s s h o w t h e e s t i m a t e d h i d d e n s t a t e a s c a l c u l a t e d b y t h e

    i n f e r r e d H M M . T h e e s t i m a t e d s t a t e s a r e o n l y v i s i b l e w h e r e t h e y d i e r f r o m t h e t r u e s t a t e s .

    T h i s o c c u r s m a i n l y f o r ( t r u e ) t r a n s i t i o n s f r o m s t a t e 3 t o s t a t e 1 ( s e e t e x t f o r e x p l a n a t i o n ) .

    ( a )

    1.1 1 0.9 0.8 0.7 0.6 0.5 0.40.8

    0.6

    0.4

    0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    ( b )

    1 2 3 4 5 6 7 82000

    1900

    1800

    1700

    1600

    1500

    1400

    1300

    1200

    Number of Gaussians

    DescriptionLength

    F i g u r e 7 : ( a ) A R ( 8 ) c o e c i e n t s p r o j e c t e d o n t o t h e i r r s t t w o p r i n c i p a l c o m p o n e n t s . T h e

    d a t a p o i n t s a r e i d e n t i e d b y t h e i r t r u e s t a t e l a b e l s s t a t e 1 - p u r e b e t a ( d o t s ) , s t a t e 2 - a l p h a

    a n d b e t a ( c r o s s e s ) a n d s t a t e 3 - p u r e a l p h a ( c i r c l e s ) . T h e s e l a b e l s a r e , o f c o u r s e , u n k n o w n

    t o t h e H M M i n f e r e n c e a l g o r i t h m ( b ) D e s c r i p t i o n l e n g t h o f G a u s s i a n M i x t u r e M o d e l s .

    7

  • 8/10/2019 Gaussian Observation HMM for EEG

    8/9

  • 8/10/2019 Gaussian Observation HMM for EEG

    9/9

    w h e r e a

    i

    a r e t h e A R c o e c i e n t s a n d e

    t

    i s I I D G a u s s i a n n o i s e w i t h z e r o m e a n a n d v a r i a n c e

    2

    T h e f r e q u e n c y d o m a i n c h a r a c t e r i s t i c s o f a n A R m o d e l m a y b e o b t a i n e d b y t a k i n g t h e

    z - t r a n s f o r m o f t h e a b o v e e x p r e s s i o n a n d s u b s t i t u t i n g z = e x p ( j 2 f T ) t o o b t a i n t h e p o w e r

    a t f r e q u e n c y f f o r s a m p l i n g p e r i o d T 4

    P ( f ) =

    2

    1 +

    P

    p

    i

    a

    i

    e x p ( ; i j 2 f T )

    ( 5 )

    B M u l t i v a r i a t e a u t o r e g r e s s i v e ( M A R ) m o d e l s

    A m u l t i v a r i a t e a u t o r e g r e s s i v e ( M A R ) m o d e l i s a l i n e a r p r e d i c t o r u s e d f o r m o d e l l i n g m u l t i p l e

    t i m e s e r i e s . A n M A R ( p ) m o d e l p r e d i c t s t h e n e x t v e c t o r v a l u e i n a d - d i m e n s i o n a l t i m e s e r i e s ,

    y

    t

    a s a l i n e a r c o m b i n a t i o n o f t h e p p r e v i o u s v e c t o r v a l u e s o f t h e t i m e s e r i e s

    y

    t

    = ;

    p

    X

    i

    a

    i

    y

    t ; i

    + e

    t

    ( 6 )

    w h e r e e a c h a

    i

    i s a d ; b y ; d m a t r i x o f A R c o e c i e n t s a n d e

    t

    i s a n I I D G a u s s i a n n o i s e v e c -

    t o r w i t h z e r o m e a n a n d c o v a r i a n c e C . T h u s , t h e M A R m o d e l h a s t h e G a u s s i a n o b s e r v a t i o n

    m o d e l a s a s p e c i a l c a s e ( w h e r e o n l y t h e n o i s e t e r m i s i n c l u d e d ) .

    T h e f r e q u e n c y d o m a i n c h a r a c t e r i s t i c s o f a m u l t i v a r i a t e t i m e - s e r i e s m a y b e s u m m a r i s e d

    b y t h e H e r m i t i a n p o w e r s p e c t r a l d e n s i t y ( P S D ) m a t r i x ( M a r p l e 1 ] p a g e 3 8 7 )

    P ( f ) =

    0

    B

    B

    B

    @

    P

    1 1

    ( f ) P

    1 2

    ( f ) P

    1 d

    ( f )

    P

    1 2

    ( f ) P

    2 2

    ( f ) P

    2 d

    ( f )

    : : : : : : : : : : : : : : : : : : : : : : : : : : : :

    P

    1 d

    ( f ) P

    2 d

    ( f ) P

    d d

    ( f )

    1

    C

    C

    C

    A

    ( 7 )

    w h e r e t h e d i a g o n a l e l e m e n t s c o n t a i n t h e s p e c t r a o f i n d i v i d u a l c h a n n e l s a n d t h e o -

    d i a g o n a l e l e m e n t s c o n t a i n t h e c r o s s - s p e c t r a . T h e c o m p l e x c o h e r e n c e f u n c t i o n i s g i v e n b y

    ( M a r p l e 1 ] p . 3 9 0 )

    i j

    ( f ) =

    P

    i j

    ( f )

    p

    P

    i i

    ( f )

    q

    P

    j j

    ( f )

    ( 8 )

    T h e c o h e r e n c e s p e c t r u m b e t w e e n t w o c h a n n e l s i s g i v e n b y

    c

    i j

    ( f ) =

    i j

    ( f )

    2

    ( 9 )

    T h e p h a s e s p e c t r u m , b e t w e e n t w o c h a n n e l s i s g i v e n b y

    i j

    ( f ) = t a n

    ; 1

    "

    I m (

    i j

    ( f ) )

    R e (

    i j

    ( f ) )

    #

    ( 1 0 )

    F o r a n M A R m o d e l t h e P S D i s g i v e n b y ( M a r p l e 1 9 8 7 p a g e 4 0 8 )

    P

    M A R

    ( f ) = T A ( f )

    ; 1

    C A ( f )

    ; H

    ( 1 1 )

    w h e r e T i s t h e s a m p l i n g p e r i o d , H d e n o t e s t h e H e r m i t i a n t r a n s p o s e a n d A ( f ) i s g i v e n b y

    A ( f ) = I +

    p

    X

    i

    a

    i

    e x p ( ; i j 2 f T ) ( 1 2 )

    w h e r e I i s t h e i d e n t i t y m a t r i x .

    9