Upload
juvenal-tordocillo
View
224
Download
0
Embed Size (px)
Citation preview
8/3/2019 Computational Field Theory
1/63
C o m p u t a t i o n a l F i e l d T h e o r y
a n d P a t t e r n F o r m a t i o n
R a u l T o r a l
D e p a r t a m e n t d e F s i c a , U n i v e r s i t a t d e l e s I l l e s B a l e a r s , 0 7 0 7 1 - P a l m a d e
M a l l o r c a , S p a i n
1 . M o n t e C a r l o M e t h o d s
1 . 1 . I n t r o d u c t i o n
I n m a n y o c c a s i o n s w e n e e d t o c o m p u t e t h e v a l u e o f a h i g h - d i m e n s i o n a l i n t e g r a l
o f t h e f o r m :
Z
1
1
d x
1
Z
1
1
d x
N
f
x
( x
1
: : : x
N
) G ( x
1
: : : x
N
)
Z
d X f
x
( X ) G ( X ) ( 1 1 )
h e r e N i s a l a r g e n u m b e r a n d w e h a v e d e n o t e d b y X t h e s e t ( x
1
: : : x
N
) o f r e a l
v a r i a b l e s . T h e f u n c t i o n f
x
( X ) i s n o n - n e g a t i v e a n d n o r m a l i z e d , i . e . :
( i ) f
x
( X ) 0
( i i )
Z
f
x
( X ) d X
Z
1
1
d x
1
Z
1
1
d x
N
f
x
( x
1
: : : x
N
) = 1
( 1 2 )
I n n e x t c h a p t e r s w e w i l l g i v e s p e c i c e x a m p l e s o f w h e n o n e n e e d s t o p e r f o r m
t h i s t y p e o f c a l c u l a t i o n . I f t h e a b o v e i n t e g r a l c a n n o t b e c o m p u t e d b y a n a l y t -
i c a l m e t h o d s ( w h i c h h a p p e n s m o r e o f t e n t h a n d e s i r e d ) , o n e h a s t o r e s o u r c e t o
n u m e r i c a l m e t h o d s . O n e m u s t r e a l i z e , h o w e v e r , t h a t a s i m p l e e x t e n s i o n o f t h e
s t a n d a r d m e t h o d s u s e d i n s m a l l { N n u m e r i c a l i n t e g r a t i o n ( S i m p s o n r u l e s , G a u s s
i n t e g r a t i o n , e t c . ( F a i r e s e t a l . 1 9 9 3 ) ) t o c o m p u t e n u m e r i c a l l y t h e v a l u e o f t h e
i n t e g r a l w i l l f a i l f o r v e r y h i g h { d i m e n s i o n a l i n t e g r a l s . F o r i n s t a n c e , l e t u s t a k e
N = 1 0 0 ( a n d t h i s i s a r a t h e r s m a l l n u m b e r f o r t y p i c a l a p p l i c a t i o n s ) a n d s u p -
p o s e w e w a n t t o u s e S i m p s o n m e t h o d s . W e n e e d t o g e n e r a t e a g r i d i n t h e X s p a c e
a n d s u m u p a l l t h e v a l u e s o f G ( X ) o n t h e p o i n t s o f t h i s g r i d . I f w e c h o o s e , s a y ,
a g r i d o f 1 0 p o i n t s p e r e v e r y c o o r d i n a t e , w e w i l l h a v e 1 0
1 0 0
t e r m s t o a d d i n t h e
S i m p s o n r u l e . I f e v e r y a d d i t i o n t a k e s 1 0
1 2
s ( a n d t o d a y ' s c o m p u t e r s t a k e m u c h
l o n g e r t h a n t h a t ) t h e t i m e n e e d e d f o r t h e c a l c u l a t i o n e x c e e d s a n y a s t r o n o m i c a l
u n i t o f t i m e ( i n c l u d i n g t h e a g e o f t h e u n i v e r s e ) . T h e s i t u a t i o n d o e s n o t i m p r o v e
8/3/2019 Computational Field Theory
2/63
2 R a u l T o r a l
b y d i m i n i s h i n g t h e n u m b e r o f p o i n t s i n t h e i n t e g r a t i o n g r i d . E v e n 2 p o i n t s p e r
i n t e g r a t i o n v a r i a b l e i s b e y o n d t h e c a p a b i l i t y o f a n y p r e s e n t ( o r f u t u r e ) c o m p u t e r .
T h e s o l u t i o n t o t h i s p r o b l e m i s g i v e n b y a p p l i c a t i o n o f t h e M o n t e C a r l o
t e c h n i q u e s ( K a l o s e t a l . 1 9 8 6 B i n d e r 1 9 9 2 , H e e r m a n n 1 9 8 6 ) . F o r o u r p a r t i c u l a r
e x a m p l e , t h e y c o n s i s t i n i n t e r p r e t i n g f
x
( X ) a s a p r o b a b i l i t y d e n s i t y f u n c t i o n
o f s o m e r a n d o m v a r i a b l e x a n d , c o n s e q u e n t l y , t h e i n t e g r a l i s n o t h i n g b u t t h e
a v e r a g e v a l u e o f t h e f u n c t i o n G ( X )
h G i =
Z
d X f
x
( X ) G ( X ) ( 1 3 )
T h e k e y i d e a b e h i n d M o n t e C a r l o i n t e g r a t i o n i s t o a p p r o x i m a t e t h e p r e v i o u s
a v e r a g e b y a s a m p l e a v e r a g e :
h G i
M
G =
1
M
M
X
k = 1
G ( X
( k )
) ( 1 4 )
w h e r e X
( k )
k = 1 : : : M a r e v a l u e s o f t h e N { d i m e n s i o n a l v a r i a b l e X d i s -
t r i b u t e d a c c o r d i n g t o t h e p r o b a b i l i t y d e n s i t y f u n c t i o n f
x
( X ) . T h i s i s c a l l e d t h e
t e c h n i q u e o f i m p o r t a n c e s a m p l i n g . T h e b a s i c p r i n c i p l e o f s a m p l i n g i s t h e s a m e
o n e t h a t a l l o w s p o l i t i c i a n s t o h a v e a n a c c u r a t e k n o w l e d g e o f t h e e l e c t i o n r e s u l t s
b e f o r e e l e c t i o n d a y b y m a k i n g r a n d o m p o l l s a m o n g s t a r e p r e s e n t a t i v e s a m p l e o f
t h e e l e c t o r s .
A m o r e p r e c i s e s t a t e m e n t o n t h e r e l a t i o n b e t w e e n t h e a v e r a g e h G i a n d t h e
s a m p l e a v e r a g e
M
G ] i s g i v e n b y t h e c e n t r a l l i m i t t h e o r e m ( F e l l e r 1 9 7 1 ) . T h i s
t h e o r e m s t a t e s t h a t , i f t h e v a l u e s o f X
( k )
a r e s t a t i s t i c a l l y i n d e p e n d e n t , t h e n t h e
s a m p l e a v e r a g e
M
t e n d s i n t h e l i m i t M ! 1 t o a G a u s s i a n d i s t r i b u t i o n o f
m e a n h G i a n d v a r i a n c e
2
M
] g i v e n b y :
2
M
=
1
M
2
G =
1
M
h G
2
i ; h G i
2
( 1 5 )
I t i s c o s t u m e r y t o e x p r e s s t h e r e l a t i o n b e t w e e n
M
G ] a n d h G i a s
h G i =
M
G
M
( 1 6 )
w h i c h i s t o b e i n t e r p r e t e d i n t h e u s u a l s t a t i s t i c a l s e n s e f o r t h e G a u s s i a n
d i s t r i b u t i o n , i . e . t h a t t h e r e i s a 9 5 4 5 % p r o b a b i l i t y t h a t h G i l i e s i n t h e i n -
t e r v a l (
M
G ; 2
M
M
G + 2
M
] ) , 9 9 7 3 % i n t h e i n t e r v a l (
M
G ;
3
M
M
G + 3
M
] ) , e t c . I n p r a c t i c e , t h e u n k n o w n v a r i a n c e
2
G ] c a n b e
r e p l a c e d b y t h e s a m p l e v a r i a n c e :
2
G
1
M
M
X
k = 1
G ( X
( k )
)
2
;
1
M
M
X
k = 1
G ( X
( k )
)
!
2
( 1 7 )
A c c o r d i n g t o r e l a t i o n ( 1 . 5 ) t h e e r r o r i n a M o n t e C a r l o i n t e g r a t i o n d e c r e a s e s a s
t h e i n v e r s e s q u a r e r o o t o f t h e n u m b e r o f s a m p l i n g s M . I n t h e c a s e t h a t t h e v a l u e s
X
( k )
a r e n o t i n d e p e n d e n t , t w o m a j o r m o d i c a t i o n s a r e n e e d e d :
8/3/2019 Computational Field Theory
3/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 3
( a ) T h e v a r i a n c e o f t h e s a m p l e a v e r a g e i s g i v e n b y :
2
M
=
2
G
M
( 2
G
+ 1 ) ( 1 8 )
w h e r e t h e a u t o c o r r e l a t i o n t i m e
G
i s g i v e n ( i n t h e l i m i t o f l a r g e M ) b y :
G
=
1
X
k = 1
G
( k ) ( 1 9 )
h e r e t h e n o r m a l i z e d a u t o c o r r e l a t i o n f u n c t i o n
G
( k ) i s d e n e d a s :
G
( k ) =
h G ( X
( k )
) G ( X
( k + k )
) i ; h G i
2
2
G
( 1 1 0 )
T h e s i t u a t i o n f o r n o n z e r o a u t o c o r r e l a t i o n t i m e c a n a r i s e , f o r i n s t a n c e ,
w h e n t h e v a l u e X
( k )
d e p e n d s o n t h e v a l u e X
( k 1 )
. I n o u r p o l l e x a m p l e ,
t h i s c a n o c c u r i f t h e k { t h p e r s o n t o b e q u e s t i o n e d l i v e s i n t h e n e i g h b o u r -
h o o d o f t h e ( k ; 1 ) { t h p e r s o n , s u c h t h a t t h e i r s o c i a l c l a s s e s a r e l i k e l y t o
b e s i m i l a r . I n t u i t i v e l y ,
G
m e a s u r e s t h e n u m b e r o f v a l u e s o f t h e s a m p l e
X
( k )
X
( k + 1 )
: : : X
( k +
G
)
t h a t w e h a v e t o d i s c a r d i n o r d e r t o c o n s i d e r t h a t
X
( k )
a n d X
( k +
G
)
a r e i n d e p e n d e n t o f e a c h o t h e r . A p r o b l e m o f M o n t e C a r l o
m e t h o d s i s t h a t , i n m a n y c a s e s o f i n t e r e s t ,
G
b e c o m e s v e r y l a r g e a n d g r o w s
w i t h t h e n u m b e r o f v a r i a b l e s N
( b ) T h e r e l a t i o n h G i =
M
G
M
] h a s t o b e i n t e r p r e t e d n o w a c c o r d i n g t o
C h e b i c h e v ' s t h e o r e m ( F e l l e r 1 9 7 1 ) :
P (
M
G ; h G i > k
M
) > 1 ;
1
k
2
( 1 1 1 )
i . e . t h e p r o b a b i l i t y t h a t h G i l i e s i n t h e i n t e r v a l (
M
G ; 2
M
M
G +
2
M
] ) i s a t l e a s t 7 5 % , t h a t i t l i e s i n (
M
G ; 3
M
M
G + 3
M
)
a t l e a s t 8 8 8 9 % , e t c .
T h e a b o v e M o n t e C a r l o i m p o r t a n c e s a m p l i n g p r o c e d u r e i s o n e o f t h e m o s t
p o w e r f u l m e t h o d s a v a i l a b l e t o c o m p u t e h i g h { d i m e n s i o n a l i n t e g r a l s . I n o r d e r t o
c o m p l e t e l y s p e c i f y t h e m e t h o d , t h o u g h , w e n e e d a p r o c e d u r e t o g e n e r a t e t h e
v a l u e s o f t h e s a m p l e s X
( k )
t h a t a p p e a r i n t h e a b o v e f o r m u l a e . T h e s e s h o u l d b e
v a l u e s o f t h e N { d i m e n s i o n a l v a r i a b l e ( x
1
: : : x
N
) d i s t r i b u t e d a c c o r d i n g t o t h e
p r o b a b i l i t y d e n s i t y f u n c t i o n f
x
( X ) . T h e r e a r e s e v e r a l m e t h o d s d e v i s e d t o g e n e r -
a t e t h e r e q u i r e d v a l u e s X
( k )
. B e f o r e w e c a n e x p l a i n t h e v e r y p o w e r f u l m e t h o d s
a v a i l a b l e w e n e e d t o s t u d y i n d e t a i l s o m e s i m p l e r c a s e s .
8/3/2019 Computational Field Theory
4/63
4 R a u l T o r a l
1 . 2 . U n i f o r m s a m p l i n g
L e t u s s t a r t w i t h a s i m p l e e x a m p l e . C o n s i d e r t h e o n e { d i m e n s i o n a l ( N = 1 ) i n t e -
g r a l :
I =
Z
1
0
d x c o s ( x ) ( 1 1 2 )
t h i s i s a p a r t i c u l a r c a s e o f E q . ( 1 . 1 ) i n w h i c h t h e f u n c t i o n f
x
( x ) i s e q u a l t o 1 i n t h e
i n t e r v a l ( 0 1 ) a n d 0 o t h e r w i s e . T h e n a m e u n i f o r m s a m p l i n g c o m e s f r o m t h e
f a c t t h a t t h e v a r i a b l e x i s e q u a l l y l i k e l y t o t a k e a n y v a l u e i n t h e i n t e r v a l ( 0 1 ) ( o r ,
g e n e r a l l y s p e a k i n g , i n a n y n i t e i n t e r v a l ( a b ) ) . A l t h o u g h o n e c o u l d , i n p r i n c i p l e ,
d e v i s e s o m e p h y s i c a l p r o c e s s t h a t w o u l d p r o d u c e v a l u e s o f a v a r i a b l e x u n i f o r m l y
d i s t r i b u t e d i n t h e i n t e r v a l ( 0 1 ) , i t i s p r e f e r a b l e , f o r m a n y r e a s o n s , t o u s e s i m p l e
a l g o r i t h m s t h a t c a n b e p r o g r a m e d o n a c o m p u t e r a n d t h a t p r o d u c e " r a n d o m {
t y p e " ( o r p s e u d o { r a n d o m ) n u m b e r s u n i f o r m l y d i s t r i b u t e d i n t h e i n t e r v a l ( 0 1 )
W e w i l l n o t d i s c u s s i n t h e s e l e c t u r e s t h e i n t e r e s t i n g t o p i c o f p s e u d o { r a n d o m
n u m b e r g e n e r a t i o n . A n e x c e l l e n t e x p o s i t i o n c a n b e f o u n d i n r e f e r e n c e s ( K n u t h
1 9 8 1 ) a n d ( J a m e s 1 9 9 0 ) . L e t u s s i m p l y a s s u m e t h a t t h e r e e x i s t s a f o r t r a n f u n c -
t i o n , w h i c h w e w i l l c a l l r a n u ( ) , w h i c h r e t u r n s a n i n d e p e n d e n t r a n d o m n u m b e r
u n i f o r m l y d i s t r i b u t e d i n t h e i n t e r v a l ( 0 1 ) . B y u s i n g s u c h a f u n c t i o n , w e c a n
i m p l e m e n t v e r y e a s i l y t h e a l g o r i t h m o f u n i f o r m s a m p l i n g :
m = 1 0 0 0
r = 0 . 0
s = 0 . 0
d o 9 9 k = 1 , m
x = r a n _ u ( )
g k = g ( x )
r = r + g k
s = s + g k * g k
9 9 c o n t i n u e
r = r / m
s = s / m - r * r
s = s q r t ( s / m )
w r i t e ( 6 , * ) r , ' + / - ' , s
e n d
f u n c t i o n g ( x )
g = c o s ( x )
r e t u r n
e n d
T h e r e a d e r s h o u l d n d o u t t h e n a m e g i v e n t o t h e f u n c t i o n r a n u ( ) i s h i s
o w n c o m p u t e r a n d r u n t h e a b o v e p r o g r a m c h e c k i n g t h a t t h e e r r o r i n t h e o u t p u t
v a l u e s c a l e s a s t h e i n v e r s e s q u a r e r o o t o f t h e n u m b e r o f s a m p l e s M
8/3/2019 Computational Field Theory
5/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 5
1 . 3 . I m p o r t a n c e s a m p l i n g f o r N = 1
I n t h e N = 1 c a s e , w h e n t h e v a r i a b l e X = x h a s o n l y o n e c o m p o n e n t , a s i m p l e a n d
i m p o r t a n t t h e o r e m a l l o w s t o g e n e r a t e x
( k )
v e r y e a s i l y . R e c a l l t h a t t h e p r o b a b i l i t y
d i s t r i b u t i o n f u n c t i o n F
x
( x ) i s d e n e d b y i n t e g r a t i o n o f t h e p r o b a b i l i t y d e n s i t y
f u n c t i o n f
x
( x ) a s :
F
x
( x ) =
Z
x
1
f
x
( y ) d y ( 1 1 3 )
T h e o r e m 1 I f f
x
( x ) i s a o n e - v a r i a b l e p r o b a b i l i t y d i s t r i b u t i o n f u n c t i o n , t h e n t h e
v a r i a b l e u = F
x
( x ) i s u n i f o r m l y d i s t r i b u t e d i n t h e i n t e r v a l ( 0 1 )
A s a c o n s e q u e n c e , w e h a v e t h e
C o r o l l a r y 1 I f u i s u n i f o r m l y d i s t r i b u t e d i n t h e i n t e r v a l ( 0 1 ) , t h e n x = F
1
x
( u )
i s d i s t r i b u t e d a c c o r d i n g t o f
x
( x )
( T h e p r o o f o f t h i s t h e o r e m i s l e f t a s a n e x e r c i s e f o r t h e r e a d e r ) . T h i s t h e -
o r e m r e d u c e s t h e p r o b l e m o f g e n e r a t i n g r a n d o m n u m b e r s a c c o r d i n g t o a g i v e n
d i s t r i b u t i o n f
x
( x ) t o t h e i n v e r s i o n o f t h e c o r r e s p o n d i n g p r o b a b i l i t y d i s t r i b u t i o n
f u n c t i o n . I f , f o r i n s t a n c e , w e w a n t t o u s e t h e m e t h o d o f i m p o r t a n c e s a m p l i n g t o
c o m p u t e t h e i n t e g r a l
I =
Z
1
0
d x e
x
x
2
( 1 1 4 )
w e c a n t a k e f
x
( x ) = e
x
i f x 0 , a n d G ( x ) = x
2
. T h i s c h o i c e f o r f
x
( x ) r e s p e c t s
p o s i t i v i t y a n d n o r m a l i z a t i o n . T o g e n e r a t e v a l u e s o f x
( k )
a c c o r d i n g t o f
x
( x ) w e
n e e d t o i n v e r t F
x
( x ) , w h i c h i n t h i s c a s e c a n b e d o n e a n a l y t i c a l l y :
F
x
( x ) =
Z
x
0
d y e
y
= 1 ; e
x
= u ! x = F
1
x
( u ) = ; l o g ( 1 ; u ) ( 1 1 5 )
S i n c e 1 ; u i s a l s o u n i f o r m l y d i s t r i b u t e d i n t h e i n t e r v a l ( 0 1 ) w e c a n w r i t e s i m p l y :
x = ; l o g ( u ) ( 1 1 6 )
w h i c h i s e q u i v a l e n t t o x = ; l o g ( 1 ; u ) f r o m t h e s t a t i s t i c a l p o i n t o f v i e w . A
p r o g r a m t o c o m p u t e i n t e g r a l ( 1 . 1 4 ) c a n b e :
m = 1 0 0 0
r = 0 . 0
s = 0 . 0
d o 9 9 k = 1 , m
x = r a n _ f ( )
g k = g ( x )
r = r + g k
s = s + g k * g k
9 9 c o n t i n u e
8/3/2019 Computational Field Theory
6/63
6 R a u l T o r a l
r = r / m
s = s / m - r * r
s = s q r t ( s / m )
w r i t e ( 6 , * ) r , ' + / - ' , s
e n d
f u n c t i o n g ( x )
g = x * x
r e t u r n
e n d
f u n c t i o n r a n _ f ( )
r a n _ f = - l o g ( r a n _ u ( ) )
r e t u r n
e n d
A t e c h n i c a l p o i n t i s t h a t , i n s o m e c a s e s , t h e f u n c t i o n F
1
x
( u ) i s n o t e x p r e s s i b l e
i n t e r m s o f e l e m e n t a r y f u n c t i o n s a n d s o m e k i n d o f a p p r o x i m a t i v e m e t h o d s ( s u c h
a s n u m e r i c a l i n t e r p o l a t i o n ) m i g h t b e n e e d e d t o c o m p u t e i t . I t i s i m p o r t a n t t o
r e a l i z e t h a t t h e d e c o m p o s i t i o n o f a g i v e n i n t e g r a l i n f
x
( x ) a n d G ( x ) t o p u t i t i n
t h e f o r m o f E q . ( 1 . 3 ) m i g h t n o t b e u n i q u e . I n t h e p r e v i o u s e x a m p l e , E q . ( 1 . 1 4 ) ,
w e c o u l d h a v e t a k e n a s w e l l f
x
( x ) = x e
x
a n d G ( x ) = x . T h i s c h o i c e , h o w e v e r ,
m a k e s t h e p r o b a b i l i t y d i s t r i b u t i o n f u n c t i o n F
x
( x ) d i c u l t t o i n v e r t .
A n i m p o r t a n t c a s e i n w h i c h t h e f u n c t i o n F
1
x
( u ) i s n o t e a s i l y c a l c u l a b l e i s
t h a t o f G a u s s i a n r a n d o m n u m b e r s ( o f m e a n z e r o a n d v a r i a n c e 1 ) f o r w h i c h t h e
p r o b a b i l i t y d e n s i t y f u n c t i o n i s :
f
x
( x ) =
1
p
2
e
x
2
= 2
( 1 1 7 )
( r a n d o m n u m b e r s y o f m e a n a n d v a r i a n c e
2
a r e e a s i l y o b t a i n e d b y t h e l i n e a r
t r a n s f o r m a t i o n y = x + ) . T h e i n v e r s e p r o b a b i l i t y d i s t r i b u t i o n f u n c t i o n i s
x =
p
2 e r f
1
( 2 u ; 1 ) ( 1 1 8 )
w h e r e e r f
1
( z ) i s t h e i n v e r s e e r r o r f u n c t i o n ( A b r a m o w i t z e t a l . 1 9 7 2 V a l l s
e t a l . 1 9 8 6 ) . T h e i n v e r s e e r r o r f u n c t i o n d o e s n o t u s u a l l y b e l o n g t o t h e s e t o f
p r e d e n e d f u n c t i o n s i n a p r o g r a m m i n g l a n g u a g e , a l t h o u g h s o m e l i b r a r i e s ( f o r
e x a m p l e , t h e N A G l i b r a r y ) d o i n c l u d e i t i n t h e i r l i s t o f f u n c t i o n s . A n a l t e r n a t i v e
t o t h e g e n e r a t i o n o f G a u s s i a n d i s t r i b u t e d r a n d o m n u m b e r s i s t h e a l g o r i t h m o f
B o x - M u l l e r - W i e n e r ( B o x e t a l . 1 9 5 8 A h r e n s e t a l . 1 9 7 2 1 9 8 8 ) w h i c h i s b a s e d
o n a c h a n g e o f v a r i a b l e s t o p o l a r c o o r d i n a t e s . N a m e l y ,
x
1
=
p
c o s ( )
x
2
=
p
s i n ( )
( 1 1 9 )
I f x
1
a n d x
2
a r e i n d e p e n d e n t G a u s s i a n v a r i a b l e s , i t i s e a s y t o p r o v e t h a t a n d
a r e i n d e p e n d e n t v a r i a b l e s . f o l l o w s a n e x p o n e n t i a l d i s t r i b u t i o n a n d a u n i f o r m
8/3/2019 Computational Field Theory
7/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 7
d i s t r i b u t i o n , s o t h a t t h e i r i n v e r s e d i s t r i b u t i o n f u n c t i o n s c a n b e e x p r e s s e d i n
t e r m s o f e l e m e n t a r y f u n c t i o n s . N a m e l y ,
f
( ) =
1
2
e
= 2
! F
( ) = 1 ; e
= 2
0
f
( ) =
1
2
! F
( ) =
2
0 2 ( 1 2 0 )
T h e r e s u l t i n g a l g o r i t h m i s :
x
1
=
p
; 2 l o g ( u ) c o s ( 2 v )
x
2
=
p
; 2 l o g ( u ) s i n ( 2 v )
( 1 2 1 )
W h e r e u a n d v a r e i n d e p e n d e n t r a n d o m v a r i a b l e s u n i f o r m l y d i s t r i b u t e d i n t h e
i n t e r v a l ( 0 1 ) . T h e m a i n a d v a n t a g e o f t h i s B o x - M u l l e r - W i e n e r a l g o r i t h m i s t h a t
i t i s e x a c t , y i e l d i n g t w o i n d e p e n d e n t G a u s s i a n v a r i a b l e s , x
1
x
2
f r o m t w o i n -
d e p e n d e n t u n i f o r m v a r i a b l e s , u v . I t s m a i n d i s a d v a n t a g e , t h o u g h , i s t h a t i t i s
e x t r e m e l y s l o w s i n c e i t i n v o l v e s t h e c a l c u l a t i o n o f t r i g o n o m e t r i c , l o g a r i t h m a n d
s q u a r e r o o t f u n c t i o n s . I n m o s t o f t h e a p p l i c a t i o n s a l i n e a r i n t e r p o l a t i o n a p -
p r o x i m a t i o n t o t h e i n v e r s e e r r o r f u n c t i o n d o e s p r o d u c e s u c i e n t l y g o o d q u a l i t y
G a u s s i a n r a n d o m n u m b e r s a t a c o n s i d e r a b l e g a i n i n s p e e d ( T o r a l e t a l . 1 9 9 3 ) . A
p o s s i b l e i m p l e m e n t a t i o n o f t h e B o x - M u l l e r - W i e n e r a l g o r i t h m i s t h e f o l l o w i n g :
f u n c t i o n r a n _ g ( )
d a t a i s / - 1 /
i s = - i s
i f ( i s . e q . 1 ) t h e n
a = s q r t ( - 2 . 0 * l o g ( r a n _ u ( ) ) )
b = 6 . 2 8 3 1 8 5 3 0 7 2 * r a n _ u ( )
r a n _ g = a * c o s ( b )
x 2 = a * s i n ( b )
r e t u r n
e n d i f
r a n _ g = x 2
r e t u r n
e n d
( a p r a c t i c a l n o t e : i t m i g h t b e n e c e s s a r y t o t e l l t h e c o m p i l e r t h a t t h e t w o f u n c t i o n s
r a n u ( ) t h a t a p p e a r i n t h e p r e v i o u s p r o g r a m p r o d u c e d i e r e n t v a l u e s a n d n e e d
t o b e c o m p u t e d s e p a r a t e l y , s o m e t i m e s c o m p i l e r s a r e t o o c l e v e r ) .
A n o t h e r i m p o r t a n t c a s e t h a t d e s e r v e s b e i n g c o n s i d e r e d e x p l i c i t l y , i n d e s p i t e o f
i t s s i m p l i c i t y , c o n c e r n s t h e g e n e r a t i o n o f e v e n t s w i t h a g i v e n p r o b a b i l i t y . I m a g i n e
w e w a n t t o s i m u l a t e t o s s i n g a b i a s e d c o i n , w i t h a p = 0 6 p r o b a b i l i t y f o r h e a d s
( a n d 0 4 f o r t a i l s ) . W e n e e d t o g e n e r a t e a v a r i a b l e t h a t t a k e s s o m e v a l u e ( 1 , f o r
e x a m p l e ) 6 0 % o f t h e t i m e s a n d a n o t h e r v a l u e ( 0 ) , 4 0 % o f t h e t i m e s . T h i s c a n
b e d o n e b y c o m p a r i n g a r a n d o m n u m b e r u u n i f o r m l y d i s t r i b u t e d i n t h e i n t e r v a l
( 0 1 ) w i t h t h e g i v e n p r o b a b i l i t y p I f u p t h e n w e t a k e x = 1 , o t h e r w i s e w e
t a k e x = 0 . T h i s i s a c h i e v e d b y t h e p r o g r a m :
8/3/2019 Computational Field Theory
8/63
8 R a u l T o r a l
i f ( r a n _ u ( ) . l t . p ) t h e n
x = 1
e l s e
x = 0
e n d i f
F o r N - d i m e n s i o n a l v a r i a b l e s ( x
1
: : : x
N
) , t h e s i t u a t i o n i s m u c h m o r e c o m -
p l e x . T h e e q u i v a l e n t o f T h e o r e m 1 s t a t e s t h a t i n o r d e r t o g e n e r a t e v a l u e s o f t h e
N { d i m e n s i o n a l v a r i a b l e ( x
1
: : : x
N
) w e n e e d ( R u b i n s t e i n 1 9 8 1 ) : ( i ) g e n e r a t e N -
i n d e p e n d e n t r a n d o m n u m b e r s ( u
1
: : : u
N
) u n i f o r m l y d i s t r i b u t e d i n t h e i n t e r v a l
( 0 1 ) ( t h i s i s t h e e a s y p a r t ) a n d ( i i ) s o l v e t h e f o l l o w i n g s e t o f e q u a t i o n s :
F
x
1
( x
1
) = u
1
F
x
2
( x
2
x
1
) = u
2
: : : : : :
F
x
N
( x
N
x
1
: : : x
N 1
) = u
N
( 1 2 2 )
W h e r e , f o r e x a m p l e , F
x
2
( x
2
x
1
) i s t h e c o n d i t i o n a l p r o b a b i l i t y d i s t r i b u t i o n f u n c -
t i o n o f t h e v a r i a b l e x
2
g i v e n t h a t x
1
h a s t a k e n a p a r t i c u l a r v a l u e , a n d s o o n .
T h e c a l c u l a t i o n o f t h e c o n d i t i o n a l p r o b a b i l i t y d i s t r i b u t i o n f u n c t i o n s i s g e n e r a l l y
a t l e a s t a s c o m p l i c a t e d a s t h e c a l c u l a t i o n o f t h e o r i g i n a l i n t e g r a l w e w a n t e d t o
c o m p u t e n u m e r i c a l l y a n d t h e a b o v e p r o c e d u r e i s o f l i t t l e p r a c t i c a l u s e . I n o r -
d e r t o d e v e l o p a l t e r n a t i v e m e t h o d s s u i t a b l e f o r t h e g e n e r a t i o n o f N - d i m e n s i o n a l
v a r i a b l e s w e n e e d r s t t o i n t r o d u c e t h e s o { c a l l e d r e j e c t i o n m e t h o d s f o r 1 v a r i a b l e .
1 . 4 . R e j e c t i o n m e t h o d f o r N = 1
I n t h o s e c a s e s t h a t t h e i n v e r s e p r o b a b i l i t y d i s t r i b u t i o n f u n c t i o n i s d i c u l t t o
c o m p u t e , t h e r e j e c t i o n m e t h o d o e r s a v e r y c o n v e n i e n t a l t e r n a t i v e . A l s o , i t i s
t h e b a s i s o f t h e N - d i m e n s i o n a l m e t h o d s w h i c h w e w i l l d e v e l o p l a t e r . T h e m e t h o d
i s b a s e d o n t h e f a c t t h a t t h e p r o b a b i l i t y d e n s i t y f u n c t i o n f
x
( x ) i s p r o p o r t i o n a l
t o t h e p r o b a b i l i t y t h a t t h e v a r i a b l e x t a k e s a p a r t i c u l a r v a l u e . I f , f o r e x a m p l e ,
f
x
( x
1
) = 2 f
x
( x
2
) , w e c a n a r m t h a t t h e v a l u e x
1
i s t w i c e a s p r o b a b l e a s t h e
v a l u e x
2
. T h e r e j e c t i o n m e t h o d ( i n i t s s i m p l e s t v e r s i o n ) p r o p o s e s t h e v a l u e s x
1
a n d x
2
w i t h t h e s a m e p r o b a b i l i t y a n d t h e n a c c e p t s t h e p r o p o s e d v a l u e x w i t h
a p r o b a b i l i t y h ( x ) p r o p o r t i o n a l t o f
x
( x ) , s u c h t h a t , i n o u r e x a m p l e , x
1
w i l l b e
a c c e p t e d t w i c e a s m a n y t i m e s a s x
2
. C o n s e q u e n t l y , x
1
w i l l a p p e a r t w i c e a s m a n y
t i m e s a s x
2
, w h i c h i s e q u i v a l e n t t o s a y i n g t h a t x
1
i s t w i c e a s p r o b a b l e a s x
2
a s d e s i r e d . W e w i l l i l l u s t r a t e t h e m e t h o d b y a n e x a m p l e . L e t u s c o n s i d e r t h e
p r o b a b i l i t y d e n s i t y f u n c t i o n :
f
x
( x ) = 6 x ( 1 ; x ) x 2 ( 0 1 ) ( 1 2 3 )
W h i c h h a s t h e s h a p e i n d i c a t e d i n F i g . 1 .
W e p r o p o s e a v a l u e o f x u n i f o r m l y i n t h e i n t e r v a l ( 0 1 ) . T h e p r o p o s e d v a l u e
h a s t o b e a c c e p t e d w i t h a p r o b a b i l i t y h ( x ) p r o p o r t i o n a l t o f
x
( x ) h ( x ) = f
x
( x )
8/3/2019 Computational Field Theory
9/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 9
F i g . 1 . P r o b a b i l i t y d e n s i t y f u n c t i o n f
x
( x ) = 6 x ( 1 ; x ) ( s o l i d l i n e ) a n d a c c e p t a n c e
p r o b a b i l i t y h ( x ) = 4 x ( 1 ; x ) ( d a s h e d l i n e )
T h e c o n s t a n t i s a r b i t r a r y b u t t h e r e s u l t i n g f u n c t i o n h ( x ) h a s t o b e i n t e r p r e t e d
a s a p r o b a b i l i t y , w h i c h m e a n s t h a t w e h a v e t o k e e p t h e b o u n d s 0 h ( x ) 1 . T h i s
y i e l d s
1
m a x
x
f
x
( x )
. O b v i o u s l y , t h e r e j e c t i o n m e t h o d i s m o r e e c i e n t w h e n t h e
a c c e p t a n c e p r o b a b i l i t y i s h i g h , w h i c h m e a n s t h a t o n e h a s t o t a k e t h e m a x i m u m
p o s s i b l e v a l u e f o r . I n o u r e x a m p l e , t h e m a x i m u m f o r f
x
( x ) i s a t x = 0 5
f
x
( 0 5 ) = 1 5 , s o t h a t w e t a k e = 2 = 3 a n d , c o n s e q u e n t l y , h ( x ) = 4 x ( 1 ; x ) , s e e
F i g . 1 . T h e a c c e p t a n c e p r o c e s s i s d o n e a s e x p l a i n e d i n t h e p r e v i o u s s e c t i o n b y
c o m p a r i n g t h e p r o b a b i l i t y h ( x ) w i t h a r a n d o m n u m b e r u n i f o r m l y d i s t r i b u t e d i n
( 0 1 ) . T h e w h o l e p r o c e s s i s r e p e a t e d u n t i l t h e p r o p o s e d v a l u e i s a c c e p t e d . T h e
n a l a l g o r i t h m c a n b e c o d e d a s :
f u n c t i o n r a n _ f ( )
h ( x ) = 4 . 0 * x * ( 1 . 0 - x )
1 x = r a n _ u ( )
i f ( r a n _ u ( ) . g t . h ( x ) ) g o t o 1
r a n _ f = x
r e t u r n
e n d
W e w i l l n o w c o n s i d e r a m o r e g e n e r a l v e r s i o n o f t h e r e j e c t i o n m e t h o d i n w h i c h
a v a l u e i s p r o p o s e d a c c o r d i n g t o s o m e p r o b a b i l i t y d i s t r i b u t i o n f u n c t i o n g
x
( x ) a n d
t h e n a c c e p t e d a c c o r d i n g t o s o m e p r o b a b i l i t y h ( x ) . T h e p r o b a b i l i t y d i s t r i b u t i o n
f u n c t i o n o f t h e j o i n t p r o c e s s " p r o p o s e t h e v a l u e x a n d a c c e p t i t " i s g
x
( x ) h ( x )
A c c o r d i n g t o t h e B a y e s t h e o r e m , t h e p r o b a b i l i t y d e n s i t y f u n c t i o n o f t h e v a r i a b l e
x g i v e n t h a t i t h a s b e e n a c c e p t e d i s ( G r i m m e t t e t a l . 1 9 8 2 ) :
f
x
( x ) =
g
x
( x ) h ( x )
R
1
1
d z g
x
( z ) h ( z )
( 1 2 4 )
8/3/2019 Computational Field Theory
10/63
1 0 R a u l T o r a l
O n e i n t e r e s t i n g t h i n g t o n o t i c e i s t h a t t h e p r e v i o u s e x p r e s s i o n i s p r o p e r l y n o r -
m a l i z e d . T h i s i s v e r y i m p o r t a n t i n t h o s e c a s e s w h e r e t h e n o r m a l i z a t i o n c o n s t a n t
f o r f
x
( x ) i s n o t k n o w n e x p l i c i t l y . L o o k i n g a t E q . ( 1 . 2 4 ) o n e c a n s e e t h a t t h e r e i s
s o m e f r e e d o m i n c h o o s i n g t h e f u n c t i o n s g
x
( x ) a n d h ( x ) . T h e o n l y r e q u i r e m e n t
i s t h a t i t s p r o d u c t g
x
( x ) h ( x ) b e p r o p o r t i o n a l t o t h e f u n c t i o n f
x
( x ) w e w a n t t o
g e n e r a t e . A n i m p o r t a n t c o n s t r a i n t i s t h a t t h e p r o p o s a l g
x
( x ) m u s t b e n o r m a l -
i z e d a n d t h a t t h e a c c e p t a n c e f u n c t i o n h ( x ) m u s t b e b o u n d i n t h e i n t e r v a l ( 0 1 )
F o r i n s t a n c e , i n t h e e x a m p l e o f E q . ( 1 . 2 3 ) , w e c o u l d h a v e c o n s i d e r e d g
x
( x ) = 2 x
T h e f u n c t i o n h ( x ) s h o u l d t h e n b e p r o p o r t i o n a l t o 3 ( 1 ; x ) . S i n c e 0 h ( x ) 1
o n e t a k e s s i m p l y h ( x ) = 1 ; x . T h e g e n e r a t i o n o f g
x
( x ) = 2 x i s s t r a i g h t f o r w a r d
s i n c e t h e i n v e r s e p r o b a b i l i t y d i s t r i b u t i o n f u n c t i o n i s G
1
x
( u ) =
p
u . T h e p r o -
p o s e d v a l u e i s a c c e p t e d w i t h p r o b a b i l i t y 1 ; x , i . e . r e j e c t e d w i t h p r o b a b i l i t y x
T h i s c a n b e c o d e d a s :
f u n c t i o n r a n _ f ( )
1 x = s q r t ( r a n _ u ( ) )
i f ( r a n _ u ( ) . l t . x ) g o t o 1
r a n _ f = x
r e t u r n
e n d
A n e c i e n t m e t h o d i s o n e t h a t r e q u i r e s , o n a v e r a g e , a s m a l l a v e r a g e n u m b e r
o f p r o p o s a l s b e f o r e a c c e p t a n c e . T h i s a v e r a g e n u m b e r i s g i v e n b y t h e i n v e r s e o f
t h e o v e r a l l a c c e p t a n c e p r o b a b i l i t y , p
a
w h i c h i s n o t h i n g b u t t h e d e n o m i n a t o r o f
e x p r e s s i o n ( 1 . 2 4 ) :
p
a
p ( a c c e p t ) =
Z
1
1
d z g
x
( z ) h ( z ) ( 1 2 5 )
I t i s e a s y t o s h o w t h a t o f t h e t w o m e t h o d s d e v e l o p e d f o r t h e f u n c t i o n ( 1 . 2 3 ) t h e
r s t a l g o r i t h m i s m o r e e c i e n t t h a n t h e s e c o n d .
L e t u s c o n s i d e r y e t a n o t h e r e x a m p l e : t o g e n e r a t e n u m b e r s d i s t r i b u t e d a c -
c o r d i n g t o
f
x
( x ) = C e x p
;
x
2
2
; x
4
( 1 2 6 )
t h e o b v i o u s c h o i c e i s ( n o t i c e t h a t t h e p r e c i s e v a l u e o f C i s n o t n e e d e d ) :
g
x
( x ) =
1
p
2
e
x
2
2
h ( x ) = e
x
4
( 1 2 7 )
H e r e g
x
( x ) i s n o t h i n g b u t a G a u s s i a n d i s t r i b u t i o n , a n d h ( x ) i s t h e o p t i m a l c h o i c e ,
g i v e n t h e c h o i c e f o r g
x
( x ) , s i n c e m a x
x
h ( x ) = 1 . T h e o v e r a l l a c c e p t a n c e p r o b a -
b i l i t y i s , a c c o r d i n g t o E q . ( 1 . 2 5 ) :
p
a
=
Z
1
1
d z
1
p
2
e
z
2
2
e
z
4
0 6 2 0 2 8 ( 1 2 8 )
A n d t h e a v e r a g e n u m b e r o f t r i a l s n e e d e d t o a c c e p t a v a l u e i s 1 = 0 6 2 0 2 8 1 6
8/3/2019 Computational Field Theory
11/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 1 1
1 . 5 . R e j e c t i o n w i t h r e p e t i t i o n
T h e r e i s a m o d i c a t i o n o f t h e r e j e c t i o n m e t h o d c o n s i s t i n g i n t h e f o l l o w i n g : i f
t h e p r o p o s e d v a l u e i s n o t a c c e p t e d t h e n , i n s t e a d o f p r o p o s i n g a n e w o n e , t h e
p r e v i o u s v a l u e i s r e p e a t e d . T h i s m e t h o d o b v i o u s l y p r o d u c e s c o r r e l a t e d v a l u e s
( s o m e o f t h e m w i l l b e e q u a l t o t h e p r e v i o u s o n e s ) b u t , h o w e v e r , c a n b e v e r y
e c i e n t f o r v e c t o r c o m p u t e r s i n w h i c h t h e u s u a l s t r u c t u r e o f t h e r e j e c t i o n m e t h o d
p r e v e n t s v e c t o r i z a t i o n . W e s t i l l h a v e t o p r o v e t h a t t h e v a l u e s g e n e r a t e d w i t h t h i s
m e t h o d d o f o l l o w t h e r e q u i r e d d i s t r i b u t i o n f
x
( x ) . A c c o r d i n g t o B a y e s t h e o r e m ,
t h e p r o b a b i l i t y d e n s i t y f u n c t i o n f
x
n
( x ) g e n e r a t e d a t t h e n { p r o p o s a l s t e p w i l l
h a v e t w o d i e r e n t c o n t r i b u t i o n s c o r r e s p o n d i n g t o t h e a c c e p t a n c e o r r e j e c t i o n ,
r e s p e c t i v e l y , o f t h e p r o p o s e d v a l u e :
f
x
n
( x ) = f
x
n
( x a c c e p t ) p ( a c c e p t ) + f
x
n
( x r e j e c t ) p ( r e j e c t ) ( 1 2 9 )
T h e r s t t e r m o f t h e r i g h t h a n d s i d e c a n b e w r i t t e n a s t h e p r o b a b i l i t y o f a c c e p -
t a n c e g i v e n x ( w h i c h i s t h e f u n c t i o n h ( x ) ) t i m e s t h e p r o b a b i l i t y d e n s i t y f u n c t i o n
o f p r o p o s i n g x ( w h i c h i s g
x
( x ) )
f
x
n
( x ) = h ( x ) g
x
( x ) + f
x
n
( x r e j e c t ) ( 1 ; p
a
) ( 1 3 0 )
I f x h a s b e e n r e j e c t e d , t h e p r e v i o u s v a l u e i s r e p e a t e d w h i c h m e a n s t h a t t h e
p r o b a b i l i t y d e n s i t y f u n c t i o n a t t h e n { s t e p i n t h e c a s e o f r e j e c t i o n i s t h e s a m e
t h a t t h e o n e a t t h e ( n ; 1 ) { s t e p :
f
x
n
( x ) = h ( x ) g
x
( x ) + f
x
n 1
( x )
1 ;
Z
1
1
d z h ( z ) g
x
( z )
( 1 3 1 )
w h e r e w e h a v e s u b s t i t u t e d p
a
a s g i v e n b y E q . ( 1 . 2 5 ) . T h e s o l u t i o n o f t h i s l i n e a r
r e c u r r e n c e r e l a t i o n i s :
f
x
n
( x ) = ( 1 ; p
a
)
n
"
f
x
0
( x ) ;
h ( x ) g
x
( x )
R
1
1
d z h ( z ) g
x
( z )
#
+
h ( x ) g
x
( x )
R
1
1
d z h ( z ) g
x
( z )
( 1 3 2 )
W e c a n w r i t e t h i s r e s u l t i n t e r m s o f t h e d e s i r e d d i s t r i b u t i o n f
x
( x ) , E q . ( 1 . 2 4 ) :
f
x
n
( x ) = ( 1 ; p
a
)
n
f
x
0
( x ) ; f
x
( x ) + f
x
( x ) ( 1 3 3 )
G i v e n t h a t 0 < p
a
1 , o n e c o n c l u d e s t h a t t h e s o l u t i o n t e n d s t o t h e d e s i r e d
d i s t r i b u t i o n i n t h e l i m i t n ! 1 i n d e p e n d e n t l y o f t h e i n i t i a l d i s t r i b u t i o n f
x
0
l i m
n ! 1
f
x
n
( x ) = f
x
( x ) ( 1 3 4 )
I f t h e i n i t i a l p r o p o s e d n u m b e r s x
0
a r e d i s t r i b u t e d a c c o r d i n g t o f
x
( x ) , i . e . i f
f
x
0
( x ) = f
x
( x ) , t h e n w e w o u l d h a v e f
x
n
( x ) = f
x
( x ) 8 n a n d t h e n u m b e r s w e
o b t a i n a r e d i s t r i b u t e d a c c o r d i n g t o t h e d e s i r e d d i s t r i b u t i o n f r o m t h e b e g i n n i n g .
H o w e v e r , i f t h e i n i t i a l n u m b e r s a r e n o t d i s t r i b u t e d a c c o r d i n g t o f
x
( x ) ( a s i t i s
u s u a l l y t h e c a s e ) w e c a n s t i l l a r m t h a t , t h a n k s t o t h e f a c t o r ( 1 ; p )
n
, t h e i n i t i a l
c o n d i t i o n w i l l b e l o s t a f t e r a n u m b e r s u c i e n t l y l a r g e o f p r o p o s a l s . T h i s p r o c e s s
o f r e j e c t i n g t h e , s a y , M
0
i n i t i a l v a l u e s p r o d u c e d b e c a u s e t h e y a r e n o t d i s t r i b u t e d
8/3/2019 Computational Field Theory
12/63
1 2 R a u l T o r a l
y e t a c c o r d i n g t o t h e r e q u i r e d d i s t r i b u t i o n i s c a l l e d t h e r m a l i z a t i o n . T h e i n i t i a l
t i m e n e e d e d f o r t h e r m a l i z a t i o n c a n b e c o m p u t e d f r o m t h e n o n - l i n e a r c o r r e l a t i o n
f u n c t i o n ( B i n d e r e t a l , 1 9 8 8 ) :
N L
x
( k ) =
h x
( k )
i ; h x i
h x
( 0 )
i ; h x i
( 1 3 5 )
T h e t i m e M
0
c a n b e m e a s u r e d a s a c h a r a c t e r i s t i c t i m e f o r t h e d e c a y o f t h e
a b o v e f u n c t i o n t o w a r d s t h e s t a t i o n a r y v a l u e 0 . F o r t h e m e t h o d o f r e j e c t i o n w i t h
r e p e t i t i o n t h e n o n - l i n e a r c o r r e l a t i o n f u n c t i o n c o i n c i d e s w i t h t h e a u t o - c o r r e l a t i o n
f u n c t i o n ( s e e l a t e r ) :
N L
x
( k ) = ( 1 ; p
a
)
k
( 1 3 6 )
T h e t h e r m a l i z a t i o n t i m e M
0
c a n b e d e n e d a s t h e t i m e i t t a k e s t h e a b o v e f u n c -
t i o n t o r e a c h a s m a l l v a l u e
M
0
=
l n
l n ( 1 ; p
a
)
( 1 3 7 )
I f , f o r i n s t a n c e , = 1 0
8
p
a
= 0 5 , w e h a v e M
0
2 7
W e c a n i l l u s t r a t e n o w t h e e n h a n c e m e n t o f t h e e r r o r s d u e t o t h e c o r r e l a t i o n s .
I n t h i s m e t h o d o f r e j e c t i o n w i t h r e p e t i t i o n , o n e c a n c o m p u t e t h e c o r r e l a t i o n
f u n c t i o n o f t h e v a r i a b l e x a s ( s e e E q . ( 1 . 1 0 ) ) :
x
( k ) = l i m
k ! 1
h x
( k )
x
( k + k )
i ; h x i
2
h x
2
i ; h x i
2
= ( 1 ; p
a
)
k
( 1 3 8 )
F r o m E q . ( 1 . 9 ) w e d e d u c e t h a t t h e a u t o c o r r e l a t i o n t i m e i s :
x
=
1
X
k = 1
x
( k ) =
1 ; p
p
( 1 3 9 )
R e m e m b e r t h a t , a c c o r d i n g t o E q . ( 1 . 8 ) t h e s t a t i s t i c a l e r r o r g e t s e n h a n c e d b y t h e
f a c t o r ( 2
x
+ 1 )
1 = 2
W e n a l l y m e n t i o n t h a t i t i s p o s s i b l e t o i n t e r p r e t t h i s a l g o r i t h m o f r e j e c t i o n
w i t h r e p e t i t i o n a s a M a r k o v s u c c e s s i o n ( G r i m m e t t e t a l . 1 9 8 2 ) . I n d e e d , E q . ( 1 . 3 1 )
c a n b e c a s t i n t h e f o r m :
f
x
n
( x ) =
Z
1
1
f ( x y ) f
x
n 1
( y ) d y ( 1 4 0 )
w h e r e t h e t r a n s i t i o n p r o b a b i l i t y i s :
f ( x y ) = h ( x ) g
x
( x ) +
1 ;
Z
1
1
d z h ( z ) g
x
( z )
( x ; y ) ( 1 4 1 )
8/3/2019 Computational Field Theory
13/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 1 3
1 . 6 . T h e a l g o r i t h m o f M e t r o p o l i s e t a l .
A l t h o u g h i t i s v e r y p o w e r f u l , t h e r e j e c t i o n m e t h o d c a n f a i l i f t h e d i s t r i b u t i o n i s
v e r y p e a k e d a r o u n d a n ( u n k n o w n ) v a l u e x
0
( s e e F i g . 2 ) . I f o u r p r o p o s a l d o e s n o t
t a k e i n t o a c c o u n t t h a t o n l y a v e r y s m a l l p a r t o f t h e v a r i a b l e s p a c e ( t h a t a r o u n d
x
0
) i s i m p o r t a n t , w e a r e b o u n d t o h a v e a e x t r e m e l y h i g h r e j e c t i o n p r o b a b i l i t y
y i e l d i n g t h e r e j e c t i o n m e t h o d c o m p l e t e l y u s e l e s s . T h e s o l u t i o n c o m e s b y m a k i n g
a p r o p o s a l t h a t d o e s n o t d i e r m u c h o f t h e p r e s e n t v a l u e o f t h e r a n d o m v a r i -
a b l e w e a r e s a m p l i n g , i . e . b y h a v i n g t h e t r a n s i t i o n p r o b a b i l i t i e s o f t h e M a r k o v
s u c c e s s i o n d e p e n d e x p l i c i t l y o n t h e p r e s e n t v a l u e , s a y y , o f t h e v a r i a b l e . T h i s
i m p l i e s t h a t t h e f u n c t i o n s h ( x ) a n d g
x
( x ) d e p e n d o n y a n d b e c o m e t w o - v a r i a b l e
f u n c t i o n s , g
x
( x y ) h ( x y ) . T h e t r a n s i t i o n p r o b a b i l i t y E q . ( 1 . 4 1 ) t h e n b e c o m e s
a l s o a t w o v a r i a b l e f u n c t i o n :
f ( x y ) = h ( x y ) g
x
( x y ) +
1 ;
Z
1
1
h ( z y ) g
x
( z y ) d z
( x ; y ) ( 1 4 2 )
F i g . 2 . F u n c t i o n f
x
( x ) f o r w h i c h t h e r e j e c t i o n m e t h o d c a n f a i l
T h e e q u a t i o n g i v i n g t h e e v o l u t i o n o f t h e p r o b a b i l i t y d e n s i t y f u n c t i o n a t t h e n -
s t e p i s s t i l l E q . ( 1 . 4 0 ) , b u t n o w t h e r e c u r s i o n e q u a t i o n f o r f
x
n
( x ) d o e s n o t t e l l
u s i n a s t r a i g h t w a y w h i c h i s t h e s t a t i o n a r y ( n ! 1 ) d i s t r i b u t i o n . W e w o u l d
l i k e t o h a v e f
x
( x ) a s s t a t i o n a r y s o l u t i o n o f t h e r e c u r s i o n e q u a t i o n , i . e :
f
x
( x ) =
Z
1
1
f ( x y ) f
x
( y ) d y ( 1 4 3 )
B y u s i n g t h e n o r m a l i z a t i o n c o n d i t i o n
R
1
1
f ( y x ) d y = 1 a n d t h e d e n i t i o n ( 1 . 4 2 )
f o r t h e t r a n s i t i o n p r o b a b i l i t y f ( x y ) , o n e g e t s e a s i l y :
Z
d y g
x
( x y ) h ( x y ) f
x
( y ) ; g
x
( y x ) h ( y x ) f
x
( x ) ] = 0 ( 1 4 4 )
8/3/2019 Computational Field Theory
14/63
1 4 R a u l T o r a l
A s u c i e n t c o n d i t i o n t o f u l l l t h i s r e l a t i o n i s g i v e n b y t h e d e t a i l e d b a l a n c e
c o n d i t i o n
g
x
( x y ) h ( x y ) f
x
( y ) = g
x
( y x ) h ( y x ) f
x
( x ) ( 1 4 5 )
t o b e s a t i s e d b y t h e p r o p o s a l g
x
( x y ) a n d t h e a c c e p t a n c e p r o b a b i l i t y h ( x y ) . L e t
u s r e m a r k t h a t i f t h e d e t a i l e d b a l a n c e c o n d i t i o n i s s a t i s e d a n d i f f
x
0
( x ) = f
x
( x )
t h e n f
x
n
( x ) = f
x
( x ) 8 n . A l s o , i f t h e t r a n s i t i o n p r o b a b i l i t i e s s a t i s f y t h e c o n d i t i o n
o f e r g o d i c i t y , w h i c h , r o u g h l y s p e a k i n g , m e a n s t h a t a n y v a l u e f o r t h e r a n d o m
v a r i a b l e c a n b e a c h i e v e d s t a r t i n g f r o m a n y o t h e r v a l u e a f t e r a s u c i e n t n u m b e r
o f s t e p s , t h e n w e c a n a s s u r e t h a t f
x
( x ) i s t h e o n l y s t a t i o n a r y s o l u t i o n o f t h e
M a r k o v s u c c e s s i o n a n d t h a t l i m
n ! 1
f
x
n
( x ) = f
x
( x ) , i n d e p e n d e n t l y o f t h e v a l u e
o f f
x
0
( x ) ( s e e K a l o s e t a l , 1 9 8 6 ) .
I t i s i m p o r t a n t t o s t r e s s t h a t a n y f u n c t i o n s g
x
( x y ) a n d h ( x y ) t h a t s a t i s f y
e r g o d i c i t y a n d t h e d e t a i l e d b a l a n c e c o n d i t i o n a r e s u i t a b l e t o u s e i n t h i s r e j e c t i o n
m e t h o d . T h e m o s t w i d e l y u s e d s o l u t i o n i s t h e o n e g i v e n b y t h e t h e M e t r o p o l i s
a l g o r i t h m ( M e t r o p o l i s e t a l . 1 9 5 3 ) i n w h i c h g
x
( x y ) i s a g i v e n f u n c t i o n u s u a l l y
o f t h e f o r m :
g
x
( x y ) =
1
2
i f x ; y ( 1 4 6 )
i . e . x i s s a m p l e u n i f o r m l y f r o m t h e i n t e r v a l ( y ; y + ) . O n c e t h e v a l u e o f
x h a s b e e n p r o p o s e d o n e l o o k s f o r a c c e p t a n c e p r o b a b i l i t i e s h ( x y ) v e r i f y i n g t h e
d e t a i l e d b a l a n c e c o n d i t i o n :
h ( x y )
h ( y x )
=
g
x
( y x ) f
x
( x )
g
x
( x y ) f
x
( y )
q ( x y ) ( 1 4 7 )
W h e n s e a r c h i n g f o r s o l u t i o n s o f t h e s e e q u a t i o n s o n e h a s t o r e m e m b e r t h a t h ( x y )
i s a p r o b a b i l i t y a n d m u s t a l s o s a t i s f y t h e c o n d i t i o n 0 h ( x y ) 1 . A p o s s i b l e
s o l u t i o n i s t h e M e t r o p o l i s s o l u t i o n
h ( x y ) = m i n ( 1 q ( x y ) ) ( 1 4 8 )
A n o t h e r w i d e l y u s e d s o l u t i o n i s t h e G l a u b e r s o l u t i o n ( G l a u b e r 1 9 6 3 ) :
h ( x y ) =
q ( x y )
1 + q ( x y )
( 1 4 9 )
A f a m i l y o f s o l u t i o n s i s o b t a i n e d b y :
h ( x y ) =
p
q ( x y ) ! ( q ( x y ) ) ( 1 5 0 )
w h e r e ! ( z ) i s a n y f u n c t i o n s a t i s f y i n g
! ( z ) = ! ( z
1
) ( 1 5 1 )
I n p a r t i c u l a r , t h e M e t r o p o l i s s o l u t i o n i s r e c o v e r e d t a k i n g :
! ( z ) = m i n ( z z
1
) ( 1 5 2 )
a n d t h e G l a u b e r s o l u t i o n t a k i n g
8/3/2019 Computational Field Theory
15/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 1 5
! ( z ) =
1
z
1 = 2
+ z
1 = 2
( 1 5 3 )
B e f o r e w e u s e t h e M e t r o p o l i s a l g o r i t h m t o s t u d y s o m e m o d e l s o f e l d t h e o r y ,
w e w a n t t o n i s h t h i s s e c t i o n b y s h o w i n g t h e u s e o f t h e M e t r o p o l i s a l g o r i t h m
w i t h a s i m p l e e x a m p l e i n a o n e v a r i a b l e c a s e . W e w i l l c o n s i d e r t h e G a u s s i a n
d i s t r i b u t i o n :
f
x
( x ) = A e
x
2
= 2
( 1 5 4 )
t h e n o r m a l i z a t i o n c o n s t a n t A i s i r r e l e v a n t f o r t h e M e t r o p o l i s m e t h o d . T h e p r o -
p o s a l w i l l b e a v a l u e b e l o n g i n g t o t h e i n t e r v a l ( y ; y + ) . N o t i c e t h a t t h i s
c h o i c e ( E q . ( 1 . 4 6 ) ) s a t i s e s t h e s y m m e t r y r e l a t i o n g
x
( x y ) = g
x
( y x ) . T h i s p r o -
p o s a l w i l l b e a c c e p t e d w i t h a p r o b a b i l i t y g i v e n , f o r e x a m p l e , b y t h e M e t r o p o l i s
s o l u t i o n E q . ( 1 . 4 8 ) :
h ( x y ) = m i n ( 1 q ( x y ) ) = m i n ( 1 e
( y
2
x
2
) = 2
) ( 1 5 5 )
i . e i f x y a c c e p t w i t h p r o b a b i l i t y 1 , o t h e r w i s e a c c e p t w i t h p r o b a b i l i t y
e
( y
2
x
2
) = 2
. T h e M e t r o p o l i s a l g o r i t h m c a n b e c o d e d a s :
f u n c t i o n r a n _ g ( y , d e l t a )
x = y + d e l t a * ( 2 * r a n _ u ( ) - 1 )
i f ( a b s ( x ) . g t . a b s ( y ) ) t h e n
i f ( e x p ( 0 . 5 * ( y - x ) * ( y + x ) ) . l t . r a n _ u ( ) ) t h e n
r a n _ g = y
r e t u r n
e n d i f
e n d i f
y = x
r a n _ g = y
r e t u r n
e n d
I n t u i t i v e l y , t h e e e c t o f t h i s a l g o r i t h m i s t o a c c e p t w i t h a l a r g e r p r o b a b i l -
i t y t h o s e p r o p o s a l s w h i c h t e n d t o w a r d s t h e o r i g i n , w h e r e t h e p r o b a b i l i t y h a s a
m a x i m u m .
A n i m p o r t a n t w a r n i n g c o n c e r n s t h e f a c t t h a t w e m u s t k e e p t h e o l d v a l u e o f
t h e v a r i a b l e i f t h e n e w o n e h a s b e e n r e j e c t e d . W e c a n n o t k e e p p r o p o s i n g u n t i l
a v a l u e i s a c c e p t e d ( a t v a r i a n c e w i t h w h a t h a p p e n e d i n t h e o r d i n a r y r e j e c t i o n
m e t h o d i n w h i c h t h e t w o p r o c e d u r e s w e r e c o r r e c t ) . I f o n e d o e s n o t k e e p t h e o l d
v a l u e , a r e a s o n i n g s i m i l a r t o t h e o n e u s e d i n t h e r e j e c t i o n m e t h o d , s e c t i o n 1 . 4 ,
l e a d s t o t h e f o l l o w i n g t r a n s i t i o n p r o b a b i l i t i e s , s e e E q . ( 1 . 2 4 ) :
f ( x y ) =
h ( x y ) g ( x y )
R
1
1
d z h ( z y ) g ( z y )
( 1 5 6 )
a n d :
f ( y x ) =
h ( y x ) g ( y x )
R
1
1
d z h ( z x ) g ( z x )
( 1 5 7 )
8/3/2019 Computational Field Theory
16/63
1 6 R a u l T o r a l
N o w i t i s v e r y d i c u l t t o s a t i s f y t h e d e t a i l e d b a l a n c e c o n d i t i o n s , E q . ( 1 . 4 5 ) ,
n a m e l y :
h ( x y ) g ( x y )
R
1
1
d z h ( z y ) g ( z y )
f
x
( y ) =
h ( y x ) g ( y x )
R
1
1
d z h ( z x ) g ( z x )
f
x
( x ) ( 1 5 8 )
s i n c e t h e i n t e g r a l s a r e g e n e r a l l y d i c u l t t o c o m p u t e ( i n p a r t i c u l a r , t h e M e t r o p o -
l i s s o l u t i o n d o e s n o t s a t i s f y t h i s c o n d i t i o n ) . T h e r e a d e r c a n t e s t t h e f o l l o w i n g
m o d i c a t i o n o f t h e M e t r o p o l i s a l g o r i t h m f o r t h e G a u s s i a n d i s t r i b u t i o n :
f u n c t i o n r a n _ g ( y , d e l t a )
1 x = y + d e l t a * ( 2 * r a n _ u ( ) - 1 )
i f ( a b s ( x ) . g t . a b s ( y ) ) t h e n
i f ( e x p ( 0 . 5 * ( y - x ) * ( y + x ) ) . l t . r a n _ u ( ) ) g o t o 1
e n d i f
y = x
r a n _ g = y
r e t u r n
e n d
a n d c h e c k t h a t i t d o e s n o t p r o d u c e G a u s s i a n r a n d o m n u m b e r s ( i t i s w o r s e f o r
l a r g e )
F o r e c i e n c y o f t h e M e t r o p o l i s a l g o r i t h m m u s t b e c h o s e n s u c h t h a t t h e
a u t o c o r r e l a t i o n t i m e o f t h e a l g o r i t h m , , t a k e s i t s m i n i m u m v a l u e . I t i s e a s y t o
u n d e r s t a n d w h y t h e r e m u s t b e a m i n i m u m o f a s a f u n c t i o n o f I f i s v e r y
s m a l l , t h e n e w p r o p o s a l w i l l b e v e r y c l o s e t o t h e o l d o n e ( h e n c e h i g h l y c o r r e l a t e d ) ,
w i l l b e l a r g e a n d h ( x y ) w i l l b e v e r y c l o s e t o 1 s u c h t h a t t h e a c c e p t a n c e w i l l b e
a l s o c l o s e t o 1 . O n t h e o t h e r h a n d , i f i s l a r g e , t h e a c c e p t a n c e p r o b a b i l i t y w i l l
b e s m a l l a n d t h e p r o p o s e d v a l u e w i l l b e o f t e n r e j e c t e d , s u c h t h a t t h e n e w v a l u e
w i l l b e e q u a l t o t h e o l d o n e ( a g a i n h i g h l y c o r r e l a t e d ) . A r u l e o f t h u m b t e l l s u s
t h a t m u s t b e c h o s e n s u c h t h a t t h e a c c e p t a n c e p r o b a b i l i t y i s n e i t h e r t o o h i g h ,
n e i t h e r t o o s m a l l , i . e . o f t h e o r d e r o f 5 0 % .
1 . 7 . R e j e c t i o n m e t h o d i n t h e N { d i m e n s i o n a l c a s e
W e r e a l l y d o n o t n e e d t o d e v e l o p a n y n e w c o n c e p t s . T h e n i c e t h i n g a b o u t t h e
M e t r o p o l i s a l g o r i t h m i s t h a t i s e a s i l y g e n e r a l i z a b l e t o t h e N - d i m e n s i o n a l c a s e .
S i m p l y r e p l a c e x a n d y i n t h e a b o v e e x p r e s s i o n s b y t h e N - d i m e n s i o n a l v a r i a b l e
v e c t o r s ( x
1
: : : x
N
) a n d ( y
1
: : : y
N
) , r e s p e c t i v e l y , a n d a l l o f t h e a b o v e f o r m u l a e
a n d c o n c e p t s w i l l s t i l l a p p l y . I n o r d e r t o k e e p t h e a c c e p t a n c e p r o b a b i l i t y w i t h i n
r e a s o n a b l e l i m i t s , t h e p r o p o s a l c a n n o t b e t o o d i e r e n t f r o m t h e o l d v a l u e . T h i s
i s a c h i e v e d b y c h a n g i n g o n l y o n e o f t h e N v a r i a b l e s a t o n e t i m e . T h e v a r i a b l e
t o b e u p d a t e d c a n b e c h o s e n r a n d o m l y a m o n g s t t h e s e t o f t h e N v a r i a b l e s o r
s e q u e n t i a l l y . I f c h o s e n r a n d o m l y t h e f u n c t i o n g
x
( x y ) i s e x p l i c i t l y g i v e n b y :
g
x
( x y ) =
1
N
N
X
i = 1
1
2
Y
j 6= i
( x
j
; y
j
) ( 1 5 9 )
8/3/2019 Computational Field Theory
17/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 1 7
S i n c e i t v e r i e s t h e s y m m e t r y c o n d i t i o n g
x
( x y ) = g
x
( y x ) , t h e f u n c t i o n
q ( x y ) i s s i m p l y q ( x y ) = f
x
( x ) = f
x
( y ) . T h e a c c e p t a n c e p r o b a b i l i t y c a n b e c h o s e n
a s t h e M e t r o p o l i s s o l u t i o n h ( x y ) = m i n ( 1 q ( x y ) ) o r o t h e r s o l u t i o n .
1 . 8 . H e a t B a t h
I n t h e M e t r o p o l i s a l g o r i t h m t h e a c c e p t a n c e p r o b a b i l i t y h ( x y ) w a s d e t e r m i n e d
( w i t h s o m e f r e e d o m ) o n c e t h e p r o p o s a l g
x
( x y ) h a d b e e n s p e c i e d . I n t h e s o
c a l l e d h e a t b a t h a l g o r i t h m , w h i c h i s u s e f u l f o r N - d i m e n s i o n a l v a r i a b l e s , t h e
p r o p o s e d v a l u e f o r t h e v a r i a b l e i s a l w a y s a c c e p t e d , i . e . o n e c h o o s e s
h ( x y ) = 1 ( 1 6 0 )
T h e d e t a i l e d b a l a n c e c o n d i t i o n b e c o m e s
g
x
( x y ) f
x
( y ) = g
x
( y x ) f
x
( x ) ( 1 6 1 )
I n t h e 1 - v a r i a b l e c a s e , a t r i v i a l s o l u t i o n ( r e m e m b e r t h a t g
x
( x y ) m u s t b e a p r o b -
a b i l i t y d e n s i t y f u n c t i o n ) i s : g
x
( x y ) = f
x
( x ) w h i c h i s i n d e p e n d e n t o f t h e o l d
v a l u e y . I n t h e N - v a r i a b l e c a s e , a s o l u t i o n i s f o u n d b y c h a n g i n g o n l y o n e o f t h e
N v a r i a b l e s a t a t i m e :
g
x
( x y ) =
1
N
N
X
i = 1
g
x
( x
i
y )
Y
j 6= i
( x
j
; y
j
) ( 1 6 2 )
w h e r e e a c h o f t h e f u n c t i o n s g
x
( x
i
y ) s a t i s e s d e t a i l e d b a l a n c e :
g
x
( x
i
y ) f
x
( x
1
: : : x
i 1
y
i
x
i + 1
: : : x
N
) =
g
x
( y
i
x ) f
x
( x
1
: : : x
i 1
x
i
x
i + 1
: : : x
N
)
( 1 6 3 )
A s o l u t i o n o f t h i s f u n c t i o n a l e q u a t i o n i s o b t a i n e d b y t a k i n g g
x
( x
i
y ) = g
x
( x
i
)
i n d e p e n d e n t o f y , a s t h e f o l l o w i n g c o n d i t i o n a l p r o b a b i l i t y :
g
x
( x
i
) = f
x
( x
i
x
1
: : : x
i 1
x
i + 1
: : : x
N
) ( 1 6 4 )
I t i s t r i v i a l t o v e r i f y d e t a i l e d b a l a n c e , E q . ( 1 . 6 3 ) , i f o n e r e m e m b e r s t h e d e n i t i o n
o f t h e c o n d i t i o n a l p r o b a b i l i t y :
f
x
( x
i
x
1
: : : x
i 1
x
i + 1
: : : x
N
) =
f
x
( x
1
: : : x
i 1
x
i
x
i + 1
: : : x
N
)
f
x
( x
1
: : : x
i 1
x
i + 1
: : : x
N
)
( 1 6 5 )
I n t u i t i v e l y , w h a t t h e h e a t b a t h m e t h o d d o e s w h e n u p d a t i n g v a r i a b l e x
i
i s
t o s e l e c t t h e v a l u e o f x
i
a c c o r d i n g t o t h e c o n d i t i o n a l p r o b a b i l i t y g i v e n t h a t
t h e r e s t o f t h e v a r i a b l e s i s x e d . T h e s e x e d v a r i a b l e s a c t a a h e a t b a t h
f o r v a r i a b l e x
i
. I n m a n y c a s e s , i t t u r n s o u t t h a t t h e c o n d i t i o n a l p r o b a b i l i t y
g
x
( x
i
) = f
x
( x
i
x
1
: : : x
i 1
x
i + 1
: : : x
N
) t a k e s a s i m p l e f o r m a n d c a n b e s a m -
p l e d b y a n y o f t h e 1 - v a r i a b l e m e t h o d s e x p l a i n e d i n t h i s c h a p t e r .
8/3/2019 Computational Field Theory
18/63
1 8 R a u l T o r a l
2
4
M o d e l
2 . 1 . I n t r o d u c t i o n a n d b a s i c d e n i t i o n s
W e w i l l i l l u s t r a t e t h e u s e o f M o n t e C a r l o t e c h n i q u e s i n e l d t h e o r y w i t h t h e
s c a l a r
4
m o d e l . T h i s m o d e l h a s b e e n u s e d i n m a n y d i e r e n t c o n t e x t s , i n s u c h
d i e r e n t t o p i c s a s q u a n t u m e l d t h e o r y ( Z i n n J u s t i n 1 9 8 9 ) o r i n t h e s t u d y o f
s t r u c t u r a l p h a s e t r a n s i t i o n s ( C o w l e y 1 9 8 0 B r u c e 1 9 8 0 B r u c e e t a l . 1 9 8 0 ) .
L e t u s c o n s i d e r a d - d i m e n s i o n a l ( h y p e r - c u b i c ) r e g u l a r l a t t i c e , c o n s i s t i n g
o f N = L
d
p o i n t s . E v e r y p o i n t i = 1 : : : N o f t h i s l a t t i c e h a s d c o o r d i n a t e s :
i = ( j
1
: : : j
d
) . P e r i o d i c b o u n d a r y c o n d i t i o n s a r e a s s u m e d o n t h i s l a t t i c e . O n
e v e r y s i t e o f t h e l a t t i c e t h e r e i s a s c a l a r v a r i a b l e
i
. T h e s e t o f a l l v a r i a b l e s i s
(
1
: : :
N
) . W e a l s o i n t r o d u c e a H a m i l t o n i a n f u n c t i o n H g i v e n b y :
H ( ) =
N
X
i = 1
a
d
0
"
; b
2
2
i
+
u
4
4
i
+
K
2
d
X
= 1
i
;
i
a
0
2
#
( 2 1 )
T h e s u m o v e r r u n s o v e r d - n e a r e s t n e i g h b o u r s o f s i t e i , i . e . i f t h e c o o r d i n a t e s
o f i a r e ( j
1
: : : j
d
) t h e n t h e c o o r d i n a t e s o f i
a r e ( j
1
: : : j
+ 1 : : : j
d
) . T h e
c o n t i n u u m l i m i t o f t h e s y s t e m c a n b e o b t a i n e d b y l e t t i n g t h e l a t t i c e s p a c i n g a
0
t e n d t o 0 a n d t h e s y s t e m s i z e L t o 1 . I n t h i s l i m i t , t h e s u m s a r e r e p l a c e d b y
i n t e g r a l s a n d t h e s u m o v e r t e n d s t o a g r a d i e n t . T h e c o n t i n u u m H a m i l t o n i a n
i s t h e n :
H ( ) =
Z
d r
; b
2
( r )
2
+
u
4
( r )
4
+
K
2
r ( r )
2
( 2 2 )
T h i s e x p r e s s i o n f o r t h e H a m i l t o n i a n i s t h e p r e f e r r e d o n e f o r a n a l y t i c a l t r e a t m e n t ,
s u c h a s s e r i e s e x p a n s i o n s o r r e n o r m a l i z a t i o n { g r o u p t r e a t m e n t s i n m o m e n t u m
s p a c e ( A m i t 1 9 8 4 ) . T h e l a t t i c e v e r s i o n i s t h e p r e f e r r e d o n e f o r n u m e r i c a l s t u d i e s ,
b e s i d e s t h e f a c t t h a t i t y i e l d s a r e g u l a r i z a t i o n o f t h e H a m i l t o n i a n ( P a r i s i 1 9 8 8 ) .
W e w i l l c o n s i d e r f r o m n o w o n o n l y t h e l a t t i c e v e r s i o n o f t h e
4
m o d e l . W e c a n
s e t t h e l a t t i c e s p a c i n g a
0
= 1 , s i n c e i t c a n b e r e s c a l e d i n t h e p a r a m e t e r s b u a n d
K
T h e r s t t w o t e r m s o f t h e s u m a p p e a r i n g i n t h e H a m i l t o n i a n ( 2 . 1 ) a r e l o c a l
t e r m s ( d e p e n d i n g o n l y o n t h e e l d a t l o c a t i o n i ) a n d c a n b e t h o u g h t o f a s l o c a l
p o t e n t i a l t e r m s V (
i
)
V (
i
) =
; b
2
2
i
+
u
4
4
i
( 2 3 )
F o r s t a b i l i t y o f t h i s l o c a l p o t e n t i a l , t h e p a r a m e t e r u m u s t b e g r e a t e r t h a n 0 .
T h e l o c a l p o t e n t i a l c h a n g e s q u a l i t a t i v e w h e n t h e p a r a m e t e r b c h a n g e s s i g n ( s e e
F i g . 3 ) . I f b 0 t h e r e a r e t w o m i n i m a o f e q u a l d e p t h l o c a t e d a t
i
=
p
b = u
T h e t h i r d t e r m i n ( 2 . 1 ) , t h e o n e m u l t i p l i e d b y K , i s c a l l e d t h e i n t e r a c t i o n
t e r m . W h e n K > 0 , t h e c o n t r i b u t i o n o f t h i s t e r m i s a l w a y s n o n n e g a t i v e a n d
t h e g r o u n d s t a t e o f t h e H a m i l t o n i a n H i s r e a c h e d w h e n t h e c o n t r i b u t i o n o f t h i s
t e r m i s z e r o , i . e . w h e n a l l t h e e l d s t a k e t h e s a m e v a l u e s
i
=
0
8 i . T h i s i s
8/3/2019 Computational Field Theory
19/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 1 9
t h e s i t u a t i o n c o n s i d e r e d b y t h e s i m p l e m e a n e l d t h e o r y ( L a n d a u e t a l . 1 9 8 0 ) .
S i n c e a l l t h e e l d s t a k e t h e s a m e v a l u e , t h e m e a n e l d H a m i l t o n i a n r e d u c e s t o :
N
1
H
M F
(
0
) =
; b
2
2
0
+
u
4
4
0
( 2 4 )
F i g . 3 . L o c a l P o t e n t i a l V ( ) , E q . ( 2 . 3 ) , i n t h e c a s e s ( i ) b > 0 a n d ( i i ) b
:
0 i f b 0
( 2 5 )
( s e e F i g . 4 ) . T o g o b e y o n d m e a n e l d t h e o r y o n e n e e d s t o c o n s i d e r u c t u a t i o n s :
t h e e l d s
i
d o n o t t a k e a c o n s t a n t v a l u e , b u t u c t u a t e f r o m o n e l a t t i c e s i t e
t o a n o t h e r . I n t h i s c a s e , w e n e e d a s t a t i s t i c a l d e s c r i p t i o n w h i c h , a c c o r d i n g t o
t h e p r i n c i p l e s o f S t a t i s t i c a l M e c h a n i c s ( P a t h r i a 1 9 7 2 ) , i s g i v e n b y t h e c a n o n i c a l
d i s t r i b u t i o n . T h e p r o b a b i l i t y d e n s i t y f u n c t i o n f ( ] ) g o v e r n i n g t h e s t a t i s t i c a l
p r o p e r t i e s o f t h e e l d s ] a t i n v e r s e t e m p e r a t u r e i s
f ( ) =
e
H
Z ( b u K )
( 2 6 )
T h e d e n o m i n a t o r o f t h i s e x p r e s s i o n i s c a l l e d t h e p a r t i t i o n f u n c t i o n a n d i t i s
t h e m u l t i p l e i n t e g r a l o f t h e n u m e r a t o r f o r a l l t h e e l d v a l u e s :
Z ( b u K ) =
Z
1
1
d
1
Z
1
1
d
N
e
H ( )
Z
d e
H ( )
( 2 7 )
T h e m a g n i t u d e s o f i n t e r e s t a r e c o m p u t e d a s a v e r a g e s o f e l d f u n c t i o n s , G ( )
w i t h t h e p r o b a b i l i t y d e n s i t y f u n c t i o n f ( )
8/3/2019 Computational Field Theory
20/63
2 0 R a u l T o r a l
h G ( ) i = Z
1
Z
d G ( ) e
H ( )
( 2 8 )
E x a m p l e o f q u a n t i t i e s o f i n t e r e s t a r e t h e m a g n e t i z a t i o n m d e n e d a s :
m = h
1
N
N
X
i = 1
i
i ( 2 9 )
t h e e n e r g y , e
e =
H
N
( 2 1 0 )
t h e m a g n e t i c s u s c e p t i b i l i t y ,
T
T
= N
2
4
h
1
N
N
X
i = 1
i
!
2
i ; h m i
2
3
5
( 2 1 1 )
t h e s p e c i c h e a t , C
V
C
V
= N
"
h
H
N
2
i ; h e i
2
#
( 2 1 2 )
a n d m a n y o t h e r s .
I n g e n e r a l , t h e s e q u a n t i t i e s d i e r c o n s i d e r a b l y f r o m t h e m e a n e l d v a l u e s . I n
F i g u r e 4 w e c a n s e e t h e d i e r e n c e b e t w e e n t h e m a g n e t i z a t i o n c o m p u t e d f r o m
a n u m e r i c a l c a l c u l a t i o n i n t w o d i m e n s i o n s a n d t h e m e a n e l d r e s u l t ( w h i c h i s
i n d e p e n d e n t o f d i m e n s i o n ) .
I t i s k n o w n t h a t t h e
4
m o d e l b e l o n g s t o t h e u n i v e r s a l i t y c l a s s o f t h e I s i n g
m o d e l ( A m i t 1 9 8 4 ) . T h i s m e a n s t h a t b o t h m o d e l s s h a r e t h e s a m e c r i t i c a l e x -
p o n e n t s a n d s c a l i n g f u n c t i o n s . H e r e , h o w e v e r , w e w a n t t o p o i n t o u t a d i e r e n t
r e l a t i o n b e t w e e n t h e t w o m o d e l s , n a m e l y , t h a t t h e I s i n g m o d e l c a n b e o b t a i n e d
a s a s u i t a b l e l i m i t o f t h e
4
m o d e l . T h e l i m i t i s o b t a i n e d a s f o l l o w s : e x p a n d i n g
t h e s q u a r e i n t h e " g r a d i e n t " t e r m a n d u s i n g t h e p e r i o d i c b o u n d a r y c o n d i t i o n s ,
o n e c a n r e w r i t e t h e H a m i l t o n i a n i n t h e f o r m :
H ( ) =
N
X
i = 1
d K ;
b
2
2
i
+
u
4
4
i
; K
X
h i j
i
j
( 2 1 3 )
w h e r e t h e s u m o v e r h i j i m e a n s s u m o v e r a l l t h e p o s s i b l e p a i r s o f i { j n e a r e s t
n e i g h b o u r s i n t h e l a t t i c e . I n t r o d u c i n g a r e s c a l e d e l d v a r i a b l e
S
i
=
i
q
b 2 d K
u
( 2 1 4 )
o n e c a n w r i t e :
H ( S ) =
N
X
i = 1
;
1
2
S
2
i
+
1
4
S
4
i
; J
X
< i j >
S
i
S
j
( 2 1 5 )
8/3/2019 Computational Field Theory
21/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 2 1
F i g . 4 . M e a n e l d m a g n e t i z a t i o n , E q . ( 2 . 5 ) ( s o l i d l i n e ) a n d t h e r e s u l t o f a n u m e r i c a l
c a l c u l a t i o n u s i n g M o n t e C a r l o t e c h n i q u e s i n t h e t w o { d i m e n s i o n a l s y s t e m ( d a s h e d l i n e ) .
I n t h i s p l o t w e u s e t h e v a l u e = 1 ( s e e E q . ( 2 . 2 1 ) f o r a d e n i t i o n o f t h e p a r a m e t e r s ) .
w i t h
=
( ; b + 2 d K )
2
u
J =
K ( b ; 2 d K )
u
( 2 1 6 )
T h e G i b b s f a c t o r i s
e
H ( S )
=
N
Y
i = 1
8
S
i
S
j
3
5
9
=
( 2 1 7 )
T h e l o c a l f a c t o r o f t h i s d i s t r i b u t i o n i s a l w a y s d o u b l e p e a k e d c e n t e r e d a r o u n d
t h e v a l u e s 1 ( s e e F i g . 5 ) . N o w w e c a n t h i n k o f t h e p a r a m e t e r a s c o n t r o l l i n g
t h e w i d t h o f t h e l o c a l e l d d i s t r i b u t i o n a r o u n d t h e s e t w o m a x i m a . A l a r g e v a l u e
f o r i m p l i e s t h a t t h e e l d i s b o u n d t o t a k e e s s e n t i a l l y t h e v a l u e s 1 , a n d S
i
b e c o m e s w h a t i s c a l l e d a s p i n v a r i a b l e . I n t h e l i m i t ! 1 w i t h J k e p t c o n s t a n t
w e r e c o v e r t h e I s i n g m o d e l . T h i s l i m i t i s o b t a i n e d i n t h e o r i g i n a l
4
m o d e l b y
t a k i n g
b ! 1
u ! 1
b
u
! c o n s t a n t J = K
b
u
( 2 1 8 )
I n t h i s l i m i t , o n e o b t a i n s f o r t h e G i b b s f a c t o r :
e
H ( S )
=
N
Y
i = 1
( S
2
i
; 1 ) e x p
2
4
J
X
< i j >
S
i
S
j
3
5
( 2 1 9 )
T h i s i s e q u i v a l e n t t o w r i t i n g :
8/3/2019 Computational Field Theory
22/63
2 2 R a u l T o r a l
H ( S ) = ; J
X
< i j >
S
i
S
j
S
i
= 1 ( 2 2 0 )
W h i c h i s n o t h i n g b u t t h e H a m i l t o n i a n o f t h e I s i n g m o d e l . F o r s m a l l e r v a l u e s o f
, t h e e l d c a n u c t u a t e a r o u n d t h e t w o m a x i m a , h e n c e t h e n a m e o f s o f t s p i n s
m o d e l t h a t s o m e t i m e s i s g i v e n t o t h e
4
m o d e l i n t h i s s i t u a t i o n ( C o w l e y 1 9 8 0
B r u c e 1 9 8 0 B r u c e e t a l . 1 9 8 0 ) .
F i g . 5 . F u n c t i o n f ( x ) = e x p
; ( ;
1
2
S
2
+
1
4
S
4
) a p p e a r i n g i n E q . ( 2 . 1 7 ) , i n t h e c a s e s
= 1 ( s o l i d l i n e ) , = 1 0 ( d a s h e d l i n e ) , = 1 0 0 ( d o t t e d { d a s h e d l i n e ) . W h e n ! 1
t h e f u n c t i o n f
x
( x ) t e n d s t o t h e s u m o f t w o d e l t a f u n c t i o n s l o c a t e d a t x = 1
2 . 2 . M o n t e C a r l o m e t h o d s
B e f o r e w e p r o c e e d f u r t h e r a n d s h o w h o w o n e c a n o b t a i n n u m e r i c a l l y t h e q u a n -
t i t i e s o f i n t e r e s t i n t h e
4
m o d e l , w e n o t i c e t h a t o n e o f t h e t h r e e p a r a m e t e r s
o f t h e m o d e l , u b K , i s r e d u n d a n t s i n c e i t c a n b e a b s o r b e d i n t h e e l d s c a l e .
M a n y w a y s o f r e d e n i n g p a r a m e t e r s h a v e b e e n u s e d i n t h e l i t e r a t u r e ( s e e ( T o r a l
e t a l . 1 9 9 0 ) f o r a r e v i e w ) . W e w i l l u s e h e r e a s i m p l e r e p a r a m e t r i z a t i o n i n w h i c h
t h e e l d i s r e s c a l e d b y a f a c t o r K
1 = 2
h e n c e y i e l d i n g a p a r a m e t e r i n d e p e n d e n t
i n t e r a c t i o n t e r m ( t h i s r e s c a l i n g i s o b v i o u s l y v a l i d o n l y i n t h e f e r r o m a g n e t i c c a s e
K > 0 ) . S p e c i c a l l y , w e i n t r o d u c e a n e w e l d , a n d t w o n e w p a r a m e t e r s a n d
b y t h e d e n i t i o n s :
= K
1 = 2
=
b
K
=
u
K
2
( 2 2 1 )
T h e H a m i l t o n i a n , i n t e r m s o f t h e s e n e w v a r i a b l e s , c a n b e w r i t t e n a s :
8/3/2019 Computational Field Theory
23/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 2 3
H ( ) =
N
X
i = 1
"
;
2
2
i
+
4
4
i
+
1
2
d
X
= 1
;
i
;
i
2
#
=
N
X
i = 1
"
~
2
2
i
+
4
4
i
;
2 d
X
= 1
i
i
#
( 2 2 2 )
( t h e s u m o v e r r u n s o v e r t h e 2 d n e a r e s t n e i g h b o u r s o f s i t e i ) . H e r e w e h a v e
i n t r o d u c e d
~
= 2 d ; ( 2 2 3 )
T h i s H a m i l t o n i a n c a n b e e x p l i c i t l y s e p a r a t e d i n t o t h e l o c a l p a r t a n d t h e i n t e r -
a c t i o n p a r t , H = H
0
+ H
I
w i t h
H
0
=
N
X
i = 1
"
~
2
2
i
+
4
4
i
#
( 2 2 4 )
H
I
= ;
X
< i j >
i
j
( 2 2 5 )
N o w i t i s a b o u t t i m e w e s t a r t a p p l y i n g w h a t w e l e a r n t i n t h e p r e v i o u s c h a p t e r
a b o u t M o n t e C a r l o t e c h n i q u e s ! T o i m p l e m e n t t h e M e t r o p o l i s a l g o r i t h m w e n e e d
t o t a k e t h e f o l l o w i n g s t e p s :
( i ) S e l e c t ( r a n d o m l y o r s e q u e n t i a l l y ) o n e o f t h e N e l d v a r i a b l e s ,
i
( i i ) P r o p o s e a c h a n g e t o a n o t h e r c l o s e v a l u e ,
i
, c h o s e n r a n d o m l y i n t h e i n t e r v a l
i
;
i
+ , w i t h a s u i t a b l e v a l u e s e l e c t e d s u c h t h a t t h e a c c e p t a n c e
p r o b a b i l i t y i s a r o u n d 0 5
( i i i ) C o m p u t e t h e c h a n g e i n e n e r g y , H t h a t t h i s p r o p o s e d c h a n g e p r o d u c e s .
( i v ) A c c e p t t h e p r o p o s e d v a l u e
i
w i t h p r o b a b i l i t y m i n ( 1 e
H
)
I n c o m p u t i n g t h e c h a n g e o f e n e r g y o n e d o e s n o t h a v e t o u s e t h e f u l l e x p r e s s i o n
( 2 . 2 2 ) , b u t r a t h e r n o t i c e t h a t m o s t o f t h e t e r m s d i s a p p e a r w h e n s u b t r a c t i n g t h e
o l d a n d t h e n e w e n e r g y , s u c h t h a t t h e c h a n g e i n e n e r g y i s s i m p l y :
H =
~
2
(
2
i
;
2
i
) +
4
(
4
i
;
4
i
) + (
i
;
i
)
2 d
X
= 1
i
( 2 2 6 )
T h i s s i m p l e M e t r o p o l i s a l g o r i t h m h a s s o m e c o n v e r g e n c e p r o b l e m s d u e t o t h e
f a c t t h a t m o s t o f t h e t r i a l s b e l o n g t o a s m a l l p r o b a b i l i t y r e g i o n . T h i s i s p a r -
t i c u l a r l y t r u e i n t h e v i c i n i t i e s o f t h e I s i n g l i m i t i n w h i c h t h e v a l u e s a r o u n d 0
h a v e a v e r y s m a l l p r o b a b i l i t y ( s e e a g a i n F i g . 5 ) . S e v e r a l m e t h o d s h a v e b e e n p r o -
p o s e d a s a n a l t e r n a t i v e t o t h e M e t r o p o l i s a l g o r i t h m a n d a l l o f t h e s e m e t h o d s
t i n t o t h e p r o p o s a l / a c c e p t a n c e s c h e m e d e v e l o p e d i n t h e p r e v i o u s c h a p t e r : u s e
a p r o p o s a l p r o b a b i l i t y d e n s i t y f u n c t i o n g
x
( x y ) ( w h e r e x (
1
: : :
N
) a n d
y (
1
: : :
N
) s t a n d f o r t h e c o m p l e t e e l d c o n g u r a t i o n a f t e r a n d b e f o r e t h e
p r o p o s a l , r e s p e c t i v e l y ) a n d a n a c c e p t a n c e p r o b a b i l i t y h ( x y ) , s a t i s f y i n g d e t a i l e d
b a l a n c e :
g
x
( x y ) h ( x y )
e
H ( y )
Z
= g
x
( y x ) h ( y x )
e
H ( x )
Z
( 2 2 7 )
8/3/2019 Computational Field Theory
24/63
2 4 R a u l T o r a l
A s u s u a l , o n l y o n e v a r i a b l e w i l l b e u p d a t e d a t a t i m e , w h a t m a k e s t h e p r o p o s a l
g
x
( x y ) b e c o m e a f u n c t i o n g
x
(
i
y ) . I n t h e a p p r o a c h o f r e f e r e n c e ( M i l c h e v e t a l .
1 9 8 6 ) t h e p r o p o s a l g
x
(
i
y ) i s c h o s e n i n d e p e n d e n t o f y a n d p r o p o r t i o n a l t o t h e
G i b b s f a c t o r o f t h e l o c a l t e r m o f t h e H a m i l t o n i a n :
g
x
(
i
) = C e x p ( ;
~
2
2
i
;
4
4
i
) ( 2 2 8 )
t h i s i s a o n e - v a r i a b l e p r o b a b i l i t y d e n s i t y f u n c t i o n t h a t c a n b e s a m p l e d b y a n y
o f t h e m e t h o d s e x p l a i n e d i n c h a p t e r 1 . T h e a u t h o r s i n r e f e r e n c e ( M i l c h e v e t a l .
1 9 8 6 ) c h o s e a n u m e r i c a l i n v e r s i o n m e t h o d . O n c e t h i s p r o p o s a l h a s b e e n t a k e n ,
i n t h e d e t a i l e d b a l a n c e c o n d i t i o n o n l y t h e i n t e r a c t i o n p a r t o f t h e H a m i l t o n i a n
a p p e a r s e x p l i c i t l y ,
h ( x y ) e
H
I
y
= h ( y x ) e
H
I
x
( 2 2 9 )
F o r t h i s e q u a t i o n w e c a n u s e t h e M e t r o p o l i s s o l u t i o n :
h ( x y ) = m i n ( 1 e
H
I
) ( 2 3 0 )
w h e r e t h e n o v e l f e a t u r e i s t h a t o n l y t h e c h a n g e o f t h e i n t e r a c t i o n e n e r g y a p p e a r s
i n t h e e x p o n e n t i a l . T h i s a d o p t s a v e r y s i m p l e f o r m :
H
I
= (
i
;
i
)
2 d
X
= 1
i
( 2 3 1 )
I n g e n e r a l , t h i s p r o c e d u r e c a n b e u s e d w h e n t h e H a m i l t o n i a n c a n b e s p l i t t e d i n a
s u m o f l o c a l t e r m s p l u s a n i n t e r a c t i o n t e r m . O n e c a n c h o s e t h e n e w v a l u e o f t h e
v a r i a b l e , i n d e p e n d e n t l y o f t h e o l d v a l u e , a c c o r d i n g t o t h e d i s t r i b u t i o n d i c t a t e d
b y t h e l o c a l t e r m . T h i s p r o p o s a l i s t h e n a c c e p t e d w i t h t h e M e t r o p o l i s p r o b a b i l i t y
u s i n g o n l y t h e i n t e r a c t i o n t e r m .
T h e h e a t - b a t h a l g o r i t h m h a s a l s o b e e n u s e d f o r t h i s m o d e l ( T o r a l e t a l . 1 9 9 0 ) .
L e t u s r e m e m b e r t h a n i n t h e h e a t - b a t h a l g o r i t h m , t h e a c c e p t a n c e p r o b a b i l i t y i s
e q u a l t o 1 ( i . e . t h e p r o p o s a l i s a l w a y s a c c e p t e d ) , o n e v a r i a b l e
i
i s c h a n g e d a t
a t i m e , a n d t h e p r o p o s a l p r o b a b i l i t y d e n s i t y f u n c t i o n g
x
(
i
) i s o b t a i n e d f r o m
a d i s t r i b u t i o n i n w h i c h a l l t h e o t h e r v a r i a b l e s r e m a i n c o n s t a n t , i . e . w e n e e d t o
i d e n t i f y e x a c t l y w h e r e d o e s t h e v a r i a b l e
i
a p p e a r s , a l l t h e o t h e r t e r m s w i l l b e
c o n s i d e r e d c o n s t a n t s . F r o m E q . ( 2 . 2 2 ) i t i s v e r y e a s y t o n d o u t t h e e x p r e s s i o n
f o r g
x
(
i
)
g
x
(
i
) = A e x p
;
~
2
2
i
;
4
4
i
+
i
2 d
X
= 1
i
!
( 2 3 2 )
A i s s o m e n o r m a l i z a t i o n f a c t o r d e p e n d i n g o n t h e v a l u e s o f t h e o t h e r e l d s ( w h i c h
a r e c o n s i d e r e d t o b e c o n s t a n t i n t h e h e a t { b a t h m e t h o d ) . T o s a m p l e t h i s o n e -
v a r i a b l e p r o b a b i l i t y d e n s i t y f u n c t i o n i t w i l l n o t b e u s e f u l t o u s e a n u m e r i c a l
i n v e r s i o n m e t h o d , b e c a u s e t h i s f u n c t i o n d e p e n d s o f t h e s u m o f t h e 2 d n e i g h b o u r s
o f s i t e i , w h i c h v a r y f r o m t r i a l t o t r i a l . T o s a m p l e t h i s d i s t r i b u t i o n w e c a n u s e
i n s t e a d a r e j e c t i o n t e c h n i q u e . I f w e i n t r o d u c e c =
P
2 d
= 1
i
, w e c a n w r i t e t h e
a b o v e f u n c t i o n a s :
8/3/2019 Computational Field Theory
25/63
C o m p u t a t i o n a l F i e l d T h e o r y a n d P a t t e r n F o r m a t i o n 2 5
g
x
(
i
) = B
h
e x p
;
4
4
i
i
"
1
~
1 = 2
p
2
e x p
;
(
i
; c =
~
)
2
2
~
1
! #
( 2 3 3 )
B i s a n o t h e r n o r m a l i z a t i o n c o n s t a n t . T h i s i s t h e p r o d u c t o f t h e f u n c t i o n
e x p ( ;
4
4
i
) a n d a G a u s s i a n d i s t r i b u t i o n o f m e a n c =
~
a n d v a r i a n c e
~
1
( f o r t h i s
w e r e q u i r e
~
> 0 ) . T h i s G a u s s i a n d i s t r i b u t i o n c a n b e g e n e r a t e d b y t h e r e l a t i o n
i
= c =
~
+
~
1 = 2
r a n g ( ) w h e r e r a n g ( ) i s a G a u s s i a n d i s t r i b u t e d r a n d o m v a r i a b l e
o f m e a n 0 a n d v a r i a n c e 1 . F i n a l l y , t h e v a l u e
i
i s a c c e p t e