Skip to content

Draft: Resolve "autocorrelation time"#568

Open
ALF-Import-Bot wants to merge 2 commits intomasterfrom
258-autocorrelation-time-2
Open

Draft: Resolve "autocorrelation time"#568
ALF-Import-Bot wants to merge 2 commits intomasterfrom
258-autocorrelation-time-2

Conversation

@ALF-Import-Bot
Copy link
Copy Markdown

In GitLab by @DishaHou on Jul 25, 2025, 18:01 UTC:

Closes #258

Assignees: @DishaHou

Reviewers: agoetz

Migrated from GitLab: https://git.physik.uni-wuerzburg.de/ALF/ALF/-/merge_requests/238

@ALF-Import-Bot
Copy link
Copy Markdown
Author

In GitLab by @DishaHou on Jul 25, 2025, 18:18 UTC:

added 1 commit

  • c82ce61 - correct the equation for auto correlation function in the doc.pdf

Compare with previous version

@ALF-Import-Bot
Copy link
Copy Markdown
Author

In GitLab by @DishaHou on Jul 25, 2025, 18:19 UTC:

requested review from @agoetz

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the sampling documentation’s definition of the autocorrelation function to better reflect how autocorrelation times are computed in the analysis routines (Issue #258).

Changes:

  • Fixes the LaTeX expression for (S_{\hat O}(t_{\mathrm{Auto}})) by moving the summation outside the fraction and adding the missing sum in the denominator.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +77 to 79
S_{\hat{O}}(t_{\textrm{Auto}})=\frac{\sum_{i=1}^{N_{\textrm{Bin}}-t_{\textrm{Auto}}}\left(O_i-\left\langle \hat{O}\right\rangle \right)\left(O_{i+t_{\textrm{Auto}}}-\left\langle \hat{O}\right\rangle \right)}{\sum_{i=1}^{N_{\textrm{Bin}}-t_{\textrm{Auto}}}\left(O_i-\left\langle \hat{O}\right\rangle \right)\left(O_{i}-\left\langle \hat{O}\right\rangle \right)}\, ,
\end{equation}
where $O_i$ refers to the Monte Carlo estimate of the observable $\hat{O}$ in the $i^{\text{th}}$ bin. This function typically shows an exponential decay and the decay rate defines the autocorrelation time.
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated equation adds the missing sums, but it still uses a single global mean ⟨Ô⟩. In the implementation (Libraries/Modules/errors_mod.F90:1473-1485), the mean (X3) is recomputed for each lag tAuto as the average over the first NBin−tAuto samples, and that lag-dependent mean is used in both numerator and denominator. To match the actual calculation (and fully resolve #258), update the notation to use a tAuto-dependent mean (and define it explicitly).

Suggested change
S_{\hat{O}}(t_{\textrm{Auto}})=\frac{\sum_{i=1}^{N_{\textrm{Bin}}-t_{\textrm{Auto}}}\left(O_i-\left\langle \hat{O}\right\rangle \right)\left(O_{i+t_{\textrm{Auto}}}-\left\langle \hat{O}\right\rangle \right)}{\sum_{i=1}^{N_{\textrm{Bin}}-t_{\textrm{Auto}}}\left(O_i-\left\langle \hat{O}\right\rangle \right)\left(O_{i}-\left\langle \hat{O}\right\rangle \right)}\, ,
\end{equation}
where $O_i$ refers to the Monte Carlo estimate of the observable $\hat{O}$ in the $i^{\text{th}}$ bin. This function typically shows an exponential decay and the decay rate defines the autocorrelation time.
S_{\hat{O}}(t_{\textrm{Auto}})=\frac{\sum_{i=1}^{N_{\textrm{Bin}}-t_{\textrm{Auto}}}\left(O_i-\left\langle \hat{O}\right\rangle_{t_{\textrm{Auto}}} \right)\left(O_{i+t_{\textrm{Auto}}}-\left\langle \hat{O}\right\rangle_{t_{\textrm{Auto}}} \right)}{\sum_{i=1}^{N_{\textrm{Bin}}-t_{\textrm{Auto}}}\left(O_i-\left\langle \hat{O}\right\rangle_{t_{\textrm{Auto}}} \right)\left(O_{i}-\left\langle \hat{O}\right\rangle_{t_{\textrm{Auto}}} \right)}\, ,
\end{equation}
where $O_i$ refers to the Monte Carlo estimate of the observable $\hat{O}$ in the $i^{\text{th}}$ bin, and the lag-dependent mean is defined as
\begin{equation}
\left\langle \hat{O}\right\rangle_{t_{\textrm{Auto}}} = \frac{1}{N_{\textrm{Bin}}-t_{\textrm{Auto}}} \sum_{i=1}^{N_{\textrm{Bin}}-t_{\textrm{Auto}}} O_i \, .
\end{equation}
This function typically shows an exponential decay and the decay rate defines the autocorrelation time.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fassaad What do you think about the copilot suggestion? I'm good either way.

Copy link
Copy Markdown
Contributor

@johanneshofmann87 johanneshofmann87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

autocorrelation time

4 participants