Comments (4)
Indeed, your solution to determine gapsize
is much better than mine! I'll adapt my code to open a PR.
from pyerrors.
I have found some cases with very large autocorrelation, where the gap is correctly identified but the windowing does not properly work - more investigation is needed.
from pyerrors.
The following code snippet seems to resolve the problems:
else:
# Standard automatic windowing procedure
tau = self.S[e_name] / np.log((2 * self.e_n_tauint[e_name][gapsize::gapsize] + 1) / (2 * self.e_n_tauint[e_name][gapsize::gapsize] - 1))
g_w = np.exp(- np.arange(1, len(tau) + 1) / tau) - tau / np.sqrt(np.arange(1, len(tau) + 1) * e_N)
for n in range(1, w_max):
if n < w_max // 2 - 2:
_compute_drho(gapsize * n + gapsize)
if g_w[n - 1] < 0 or n >= w_max - 1:
n *= gapsize
self.e_tauint[e_name] = self.e_n_tauint[e_name][n] * (1 + (2 * n + 1) / e_N) / (1 + 1 / e_N) # Bias correction hep-lat/0306017 eq. (49)
self.e_dtauint[e_name] = self.e_n_dtauint[e_name][n]
self.e_dvalue[e_name] = np.sqrt(2 * self.e_tauint[e_name] * e_gamma[e_name][0] * (1 + 1 / e_N) / e_N)
self.e_ddvalue[e_name] = self.e_dvalue[e_name] * np.sqrt((n + 0.5) / e_N)
self.e_windowsize[e_name] = n
break
All plots and, most importantly, the resulting error seem to be fine.
The dection of the gapsize is quite stable when the criterion in the if
clause is a bit relaxed, say, to 1e-10
. The fft
should be the best method to detect the gapsize
.
There is the general question of the unit of the window size and the autocorrelation time. Currently, we have a factor of gapsize, when we deal with regular and gapped chains. In the proposed fix, the unit for these numbers is one unit in terms of idl
for the window size for gapped and irregular chains. The autocorrelation time however contains the implicit factor of gapsize
. We could think of changing the output for regular chains (i.e., those with a range
as idl
) to have consistent estimates in terms of MDU
or to print the gapsize
, either determined with the new code or from the range
s
from pyerrors.
I was aware of this issue but never took the time to really dig into it. I like your solution for the modification of the windowing procedure. Maybe I am overlooking something but there might be a simpler and more stable way of obtaining the gap size directly from the idl, for example
gapsize = np.min(np.diff(self.idl[e_name]))
I see the problem related to the output but I am not sure about the best solution. Do you maybe want to open a PR with a proposal and then we can run a few test cases on the new code?
from pyerrors.
Related Issues (20)
- numerical differentiation in derived_obs not working HOT 5
- Issues with _filter_zeroes and Corr HOT 4
- Exception when applying .symmetric() to Corr containing None HOT 1
- Gamma_method() is broken for Obs that are NaN
- Multi-dimensional fits
- Bug coming from difference in search methods in sfcf inputs HOT 2
- `Corr.show()` draws prange in same color as error bars. HOT 1
- No dobs-related functions from the input submodule can be used HOT 1
- GEVP eigenvectors with errors HOT 7
- Warning in pandas tests
- Numpy 1.25 breaks a few linalg functions HOT 3
- Failing python 3.12 pytest workflow
- Duplicate data cause `gamma_method()` to fail with an unhelpful message HOT 3
- plot_history unexpected behaviour for gapped idl HOT 2
- read_hd5 in pyerrors 2.9.0 not fully backwards compatible to <=2.8.2 HOT 1
- Read specific interval with read_ms5_xsf() HOT 2
- Files keyword for multiple reps in read_sfcf HOT 2
- pyerrors does not work with the upcoming numpy 2 release HOT 7
- Corr.__getitem__ unexpected behaviour HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyerrors.