-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
rolling product should be more numerically stable
it should also handle 0 properly, now single pass algo does not handle it as it should
frollprod(c(2,2,0,2,2), 2)
#[1] NA 4 0 0 NaN
frollprod(c(2,2,0,2,2), 2, algo="exact")
#[1] NA 4 0 0 4edit:
While NaN above is an issue that have to be surely fix, the numerical stability is the issue that only affects adaptive rolling product (and therefore also partial=T) - it is due to implementation via cumprod.
Despite many attempts I have not been able to create a test case that could show the need for improving numerical stability for non-adaptive rolling product.