Commit 8905c059 authored by Boris Varbanov's avatar Boris Varbanov Committed by Michael Wimmer
Browse files

Corr description

parent a6cc9e55
......@@ -47,7 +47,7 @@ from a separate `.py`-file, put that file into `code`. It will then be visible d
Changes you make to the documentation are directly deployed to the webserver after pushing.
If you work in a separate branch called `branch_name`, the changes are deployed to
`https://compphys.quantumtinkerer.tudelft.nl/test_builds/branch_name`. In this way you can
`https://computationalphysics.quantumtinkerer.tudelft.nl/test_builds/branch_name`. In this way you can
check intermediate stages without exposing this to the students directly.
## Testing the build locally
......
......@@ -7,7 +7,7 @@ observable $A$ as
$$\langle A\rangle = \frac{1}{N} \sum_{n>0}^{N}{A_n}$$
where $N$ the total simulation time (we only consider the data *after*
where $N$ is the total simulation time (we only consider the data *after*
the equilibration phase). This average would converge to the actual
thermodynamic average if we could go to $N=\infty$. Since in our
simulation $N$ is always finite, the time average is only an *estimate* of the
......@@ -19,7 +19,7 @@ If we had statistically independent random data for an physical
observable $A$, we could compute the standard deviation of an average
$\langle A\rangle$ with the well-known formula
$$\sigma_A = \sqrt{\frac{1}{N-1} \left(\langle A^2 \rangle - \langle A \rangle^2\right)}$$.
$$\sigma_A = \sqrt{\frac{1}{N-1}\sum_n\left(A_n - \langle A \rangle \right)^2}$$.
However, this does **not** work with molecular dynamics, as we do **not** have statistically
independent random data. We are doing a time-evolution, meaning that every new
......@@ -29,14 +29,14 @@ configuration is a small variation of the previous configuration - the data thus
### The autocorrelation function
Correlated data means that the data sequence has a memory of the
previous configurations. Let's now assume that we have a sequence of
correlated data $A_n$. We can quantify the amount of correlation can
by the autocorrelation function:
previous configurations. Let's now assume that we have a sequence of
correlated data $A_n$. We can quantify the amount of correlation can
by the normalized autocorrelation function (also seen as Pearson correlation coefficient in the literature):
$$ \chi_A(t) = \sum_n \left(A_n - \langle A \rangle \right)
$$ \chi_A(t) = \frac{1}{\sigma_A^2} \sum_n \left(A_n - \langle A \rangle \right)
\left(A_{n + t} - \langle A \rangle\right) $$
that compares the fluctuations at a certain time distance. Typically
that compares the fluctuations at a certain time distance, assuming a stationary process. Typically
the autocorrelation function has an exponential decay $e^{-t/\tau}$,
where $\tau$ is the correlation time of the simulation (Note that in
my definition here the correlation "time" refers to the index $n$ and
......@@ -52,12 +52,10 @@ $$
The formula above is valid for computing the autocorrelation function for an infinitely
long time-series. To compute it from your finite length simulation data, you
can use the formula
$$ \chi_A(t) = \frac{1}{N - t}
\sum_{n=1}^{N-t} A_n A_{n+t} - \frac{1}{N-t}
\sum_{n=1}^{N-t} A_n \times \frac{1}{N-t}
\sum_{n=1}^{N-t} A_{n+t}\,.
$$
To get $\tau$ you would then have to fit $\chi_A(t)$ to $e^{-t/\tau}$.
\chi_A(t) = \frac{\left(N-t\right)\sum_{n} A_n A_{n+t} - \sum_{n} A_n \times \sum_{n} A_{n+t}}{\sqrt{\left(N-t\right)\sum_{n} A_n^2 - \left(\sum_{n} A_n\right)^2}\sqrt{\left(N-t\right)\sum_{n} A_{n+t}^2 - \left(\sum_{n} A_{n+t}\right)^2}}
$$
for $1 \leq n\leq N-t$. To get $\tau$ you would then have to fit $\chi_A(t)$ to $e^{-t/\tau}$.
#### Example
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment