rEDM
rEDM copied to clipboard
Prediction seems to erroneously use knowledge of the value being predicted
I'm using the notation from Deyle et al.'s (2013, PNAS, 110:6430-6435) Supporting Information. A time series has values X(t), and so for E=2 the lagged space consists of vectors x(t) = (X(t), X(t-1)).
For target time t*, we are trying to predict the X(t* + 1) value. By definition, X(t* + 1) is included in x(t* + 2) = ( X(t* + 2), X(t* + 1) ) and so it seems that we should not be allowed to use x(t* + 2) to predict X(t* + 1).
However, I think that the current rEDM::block_lnlp()
function does allow this.
I have forked rEDM
and created a new test test_12_block_neighbor.R
to demonstrate the issue, see: https://github.com/andrew-edwards/rEDM/tree/andydev (andydev is the branch). The test currently fails, but I think should pass if I am correct and block_lnlp()
gets updated (I can't easily see how to do that, sorry). The test code can be stepped through to check the results (just don't run the testthat::test_that
line).
I can provide more details if anything is not clear, and happy to discuss anything. I started with test_05_simplex_calculations.R
that Hao wrote to test an earlier issue, and adapted that to make the new calculations and the new test. Thanks.