9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where...

19
9. Convergence and 9. Convergence and Monte Carlo Errors Monte Carlo Errors

Transcript of 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where...

Page 1: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

9. Convergence and 9. Convergence and Monte Carlo ErrorsMonte Carlo Errors

9. Convergence and 9. Convergence and Monte Carlo ErrorsMonte Carlo Errors

Page 2: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Measuring Convergence to

Equilibrium• Variation distance

1 2 1 2

1 2

|| || max| ( ) ( )|

1 | ( ) ( ) |

2

A

i

P P P A P A

P i P i

where P1 and P2 are two probability distributions, A is a set of states, i is a single state.

Page 3: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Eigenvalue Problem• Consider the matrix S defined by

[S]ij = pi½ W(i->j) pj

then S is real and symmetric and eigenvalues of S satisfy|n| ≤ 1

• One of the eigenvalue must be 0=1 with eigenvector pj

½.

Page 4: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Spectrum Decomposition

• Then we haveUTSU = Λ, or S = U Λ UT

where Λ is a diagonal matrix with diagonal elements k and U is orthonormal matrix, U UT = I.

• W can be expressed in U, P, and Λ asW = P-½UΛUTP½

Page 5: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Evolution in terms of eigen-states

• Pn= P0Wn

= P0 P-½UΛUTP½ P-½UΛUTP½…

= P0 P-½UΛnUTP½

• In component form, this means

Pn(j) = ∑iP0(i) pi

-½pj½∑

kk

n uikujk

Page 6: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Discussion• In the limit n goes to ∞,

Pn(j) ≈ ∑iP0(i) pi-½pj

½ ui0uj0 = pj

• The leading correction to the limit isPn(j) ≈ pj + a 1

n = pj + a e-n/

Page 7: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Exponential Correlation Time

• We define by the next largest eigenvalue

= - 1/log 1

This number characterizes the theoretical rate of convergence in a Markov chain.

Page 8: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Measuring Error

• Let Qt be some quantity of interest at time step t, then sample average is

QN = (1/N) ∑t Qt

• We treat QN as a random variable. By central limit theorem, QN is normal distributed with a mean <QN>=<Q> and variance σN

2 = <QN2>-<QN>2.

<…> standards for average over the exact distribution.

Page 9: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Confidence Interval

• The chance that the actual mean <Q> is in the interval[ QN – σN, QN + σN ]is about 68 percents.

• σN cannot be computed (exactly) in a single MC run of length N.

Page 10: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Estimating Variance

22

1, 1

int

1

var( ) ( ) 1

var( )

N

N t s t st s

N

t N

Q Q Q QN

tQf t

N N

QN

The calculation of var(Q) = <Q2>-<Q>2 and int can be done in a single run of length N.

Page 11: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Error Formula• The above derivation gives the famous

error estimate in Monte Carlo as:

where var(Q) = <Q2>-<Q>2 can be estimated by sample variance of Qt.

intvar( ) 1Error N

QN N

Page 12: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Time-Dependent Correlation function and integrated correlation

time

• We define

and

22( ) s s t s s t

s s

Q Q Q Qf t

Q Q

int0, 1, 2,... 1

( ) 1 2 ( )t t

f t f t

Page 13: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Circular Buffer for Calculating f(t)

Qt, Current time t

Qt-1 Previous time t-1

Earliest time t-(M-1)

We store the values of Qs of the previous M-1 times and the current value Qt

Qs

Page 14: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

An Example of f(t)

Time-dependent correlation function for 3D Ising at Tc on a 163 lattice; Swendsen-Wang dynamics.

From J S Wang, Physica A 164 (1990) 240.

Page 15: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Efficient Method for Computing int

We compute int by the formula

int = N σN2/var(Q)

For small value N and then extrapolating N to ∞.

From J S Wang, O Kozan and R H Swendsen, Phys Rev E 66 (2002) 057101.

Page 16: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Exponential and integrated correlation

times

where 1 < 1 is the second largest eigenvalue of W matrix. This result says that exponential correlation time (=-1/log1) is related to the largest integrated correlation time.

1int

1

1sup ( )

1 Q

Q

Page 17: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Critical Slowing Down

Tc T

The correlation time becomes large near Tc. For a finite system (Tc) Lz, with dynamical critical exponent z ≈ 2 for local moves

Page 18: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Relaxation towards Equilibrium

Time t

Magnetization m

T < Tc

T = Tc

T > Tc

Schematic curves of relaxation of the total magnetization as a function of time. At Tc relaxation is slow, described by power law:

m t -β/(zν)

Page 19: 9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.

Jackknife Method• Let n be the number of independent

samples• Let c be some estimate using all n

samples• Let ci be the same estimate but using n-

1 samples, with i-th sample removed• Then Jackknife error estimate is

2

1

( )n

J ii

c c