Conversation
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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).
| 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. |
There was a problem hiding this comment.
@fassaad What do you think about the copilot suggestion? I'm good either way.
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