Conversation
…tput keeps the same convention that was used: SSP and ABI, and adds SSP_short/long, and ABI_short/long
…calculated values are identical, it does not break functionality)
|
Thanks Jairo, great to see you were able to speed it up the code. Ian and I worked only with 1 minute epoch data and for us speed was acceptable at the time. So, probably that is why I did not make more effort to speed it up. Before I do the review, could you please consider the following: Function DFA appears to be no longer used (?) and still has the inefficient for-loop, while the new code inside function SSP is essentially what DFA does but this is not communicated. Would it not be better to keep the new functionality inside DFA such that SSP remains largely unchanged and it is clear to everyone that this PR only makes local changes to the DFA step focussed on speed and does not revise the general logic of how SSP and DFA work together? I recognise new code snippets from SSP that came from DFA, and it is reassuring that the unit-tests are not changed, but with so many new lines it would almost seem the algorithm itself is new. |
|
That makes sense. As the I will push the updates shortly. |
…SSP (suggested by Vincent)
…e matrix with box sizes and amplitudes, not the alpha (alpha is calculated in SSP)
Fixes #1499 => This PR proposes a vectorized approach to Detrended Fluctuation Analysis (DFA). The implementation replaces nested loops and repeated
lm.fitcalls with matrix algebra, significantly improving performance, especially for short epoch lengths, while maintaining the exact same output.If finally accepted, the
DFAfunction would not be called as the analyses are directly conducted in theSSPfunction, so theDFAfunction could be removed.Fixes #1501 => Now, the PR also includes the calculation of
alpha_1andalpha_2and related output estimates (SSP,ABI,SSP_short,ABI_short,SSP_long,ABI_long, andSSP_diff). The documentation has been updated to describe the new indices calculated.Checklist before merging:
inst/NEWS.Rdwith a user-readable summary. Please, include references to relevant issues or PR discussions.DESCRIPTION,zenodo.json, andinst/CITATIONfiles.If NEW GGIR parameter(s) were added then these NEW parameter(s) are:
man/GGIR.RdR/load_params.RR/check_params.Rvignettes/GGIRParameters.Rmdwith references to the GGIR parts the parameter is used in.If GGIR parameter(s) were deprecated these parameter(s) are:
man/GGIR.RdR/load_params.RR/check_params.Rvignettes/GGIRParameters.RmdR/extract_params.Rwith deprecated parameters such that these do not produce warnings when found in old config.csv files.