The error is replicated by the following:
library(RTransferEntropy)
x <- c(79652133, 88786612, 95234422, 99336996, 100764257, 105189366, 121472911,
119542332, 119862125, 120657508, 124405340, 125345113, 132920670, 137487222)
y <- c(211363, 217291, 226623, 230039, 239212, 247339, 255805, 264450, 282990,
304316, 314135, 313509, 331670, 348884)
te_result <- transfer_entropy(x, y, nboot = 100)
te_result
The error can be traced to the markov_boot_step function (ie turning the nboot option off (=0) makes the function work for now).
To be more precisely, the function calculates the transition probabilities here when a "3" is drawn, the algorithm crashes.
Eg to replicate:
# the internal representation of the earlier data
x <- c(1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3)
RTransferEntropy:::calculate_transition_probabilities(x, 1)
#> $`1`
#> 1 2
#> 1
#>
#> $`2`
#> 2 2 2 3
#> 0.91666667 0.08333333
therefore when the draw variable is found to be a "3", then the error occurs.
The error is replicated by the following:
The error can be traced to the
markov_boot_stepfunction (ie turning thenbootoption off (=0) makes the function work for now).To be more precisely, the function calculates the transition probabilities here when a "3" is drawn, the algorithm crashes.
Eg to replicate:
therefore when the
drawvariable is found to be a "3", then the error occurs.