Fix acf and acvf default handling#36
Conversation
|
Since This is my understanding: when debugging, set |
|
with the test fails with |
|
Glad you've found the docs for Please change the I've noticed that the values in the |
|
I've got so I must not have the default correct. Hmmm. Does this make sense/look right? If so, I'll change the It was nice to find that a matrix works like |
mohawk2
left a comment
There was a problem hiding this comment.
Simplifying the code by using features that remove the need for PMCode is great! Some more tweaks requested :-)
|
Ok, final version now (fixed my bug). I've made the same changes to I would have organized all the test blocks in t/ts.t into BTW, out of curiosity, what's the reason for getting rid of the And thank you so very much for |
| is_pdl $a->acf(0), pdl('[1]'), 'first value of the autocorrelation function is always 1'; | ||
| is_pdl $a->acf(5), $acf->slice('0:5'), 'autocorrelation function with 5 lags'; | ||
|
|
||
| note 'Take autocorrelation on higher order pdls to be a collection of 1D arrays'; |
There was a problem hiding this comment.
Is this just a comment that PDL's broadcasting exists and works? Please remove this unless there is actual value added, which I don't see yet.
There was a problem hiding this comment.
converted to a comment for maintainers saying what is being tested and why it is written the way it is. ie I didn't know before writing the test that the acvf of (0 .. 9) == acvf of (10 .. 19) and it tells the reader that this works like sumover, not sum.
There was a problem hiding this comment.
That sort of thing belongs in the docs, not in a bit of invisibly-output stuff in a test. Thanks for removing it. By the way, as you know, your doc improvements are also much appreciated!
Moved PMCode logic to Pars with defaults and added subtest
Test fails because
CALCis undefined (I blame my knowledge of PP) I'm still going through PP docs and the Book, but putting this PR up in case it's an easy to correct obvious mistake. I added aint h;to avoid warnings about an undefined variable. I'll keep looking at it.Report
message from PR #35 for reference
Changing or-assignment to defined-assignment so that acf(0) and acvf(0) return a single value as expected, not all values which is the default behaviour when no argument is given. plot_acf was not affected by the bug, but there's no current test for it.
The definition of acf is that it is the normalization of acvf using the value of the acvf with no lag.
This commit makes it behave as described in docs for TS.pm