Skip to contents

geometric_adstock_weights is a function that is called to generate a vector of weights that define how media impressions will be decayed in present and carried over into the future.

Usage

geometric_adstock_weights(decay = 0.5, max_carryover = 12, normalize = TRUE)

Arguments

decay

decay rate

max_carryover

maximum carryover

normalize

should the result be scaled?

Value

a numeric vector of weights of length (max_carryover)

Examples

geometric_adstock_weights()
#>  [1] 0.5001221001 0.2500610501 0.1250305250 0.0625152625 0.0312576313
#>  [6] 0.0156288156 0.0078144078 0.0039072039 0.0019536020 0.0009768010
#> [11] 0.0004884005 0.0002442002
geometric_adstock_weights(decay = 0.1)
#>  [1] 9e-01 9e-02 9e-03 9e-04 9e-05 9e-06 9e-07 9e-08 9e-09 9e-10 9e-11 9e-12
geometric_adstock_weights(max_carryover = 3)
#> [1] 0.5714286 0.2857143 0.1428571
geometric_adstock_weights(decay = 0.4, max_carryover = 4, normalize = FALSE)
#> [1] 1.000 0.400 0.160 0.064