if (FALSE) { # identical(tolower(Sys.getenv("NOT_CRAN")), "true")
weighting_function <- decay_stepped(
c(10, 20, 30, 40),
weights = c(0.75, 0.5, 0.25, 0)
)
weighting_function(c(5, 25, 35, 45))
weighting_function <- decay_stepped(
list(c(10, 20, 30, 40), c(10, 20, 30, 40)),
weights = list(c(0.75, 0.5, 0.25, 0), c(0.8, 0.6, 0.4, 0.2))
)
weighting_function(c(5, 25, 35, 45))
# intervals are open on the right, so the values change exactly at each step
weighting_function(c(0, 10, 20, 30, 40))
}
Run the code above in your browser using DataLab