View source: R/transform-forecasts.R
log_shift | R Documentation |
Function that shifts a value by some offset and then applies the natural logarithm to it.
log_shift(x, offset = 0, base = exp(1))
x |
vector of input values to be transformed |
offset |
Number to add to the input value before taking the natural logarithm. |
base |
A positive number: the base with respect to which logarithms are computed. Defaults to e = exp(1). |
The output is computed as log(x + offset)
A numeric vector with transformed values
Transformation of forecasts for evaluating predictive performance in an epidemiological context Nikos I. Bosse, Sam Abbott, Anne Cori, Edwin van Leeuwen, Johannes Bracher, Sebastian Funk medRxiv 2023.01.23.23284722 \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1101/2023.01.23.23284722")} https://www.medrxiv.org/content/10.1101/2023.01.23.23284722v1 # nolint
library(magrittr) # pipe operator
log_shift(1:10)
log_shift(0:9, offset = 1)
example_quantile[observed > 0, ] %>%
as_forecast_quantile() %>%
transform_forecasts(fun = log_shift, offset = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.