Open ljschumacher opened 4 years ago
I just ran into this myself. I was poking around in the hope of possibly open a PR but I realised that I don't understand the autocorrelation well enough to implement something myself. I'm happy to just remove any reference to the axis
argument. I don't mind looping over dimensions and walkers myself.
On a related note, though, I noticed that integrated_time
seems to expect the time series in a different order to the default chain layout. Specifically, line 85 of autocorr.py
unpacks the dimensions as
n_t, n_w, n_d = x.shape
Assuming n_t
, n_w
and n_d
are the numbers of steps, walkers and dimensions, respectively, then the default chain structure I get is (n_w, n_t, n_d)
. I think this is the axis-swapping that @ljschumacher referred to above.
The order is actually correct if you use the (preferred) get_chain
method instead of the chain
property. In the back end, the chain is stored as n_t, n_w, n_d
as expected, but the chain
property has the "wrong" shape for backwards compatibility:
I did at one point try re-implementing the axis
feature, but ran into some bookkeeping issues that I don't totally remember... I'd be happy to review a PR that implements this feature, but perhaps in the meantime I should just fix that docstring :D
General information:
Problem description: The docstring for the integrated_time function still mentions the argument 'axis', which does not seem to be implemented anymore. It would be great if the axis argument could be specified, to avoid having to swap axes before passing to this function.
See lines 47 onwards in autocorr.py