Skip to contents

A function that will convolve over the one dimensional vector of raw impressions over time and apply the adstock weights.

Usage

convolve_adstock_weights(x, w)

Arguments

x

vector

w

weights

Value

a numeric vector of length(x) with adstock transformed media impressions.

Examples

data(mmm_imps)
x <- mmm_imps$mi_banners
w <- geometric_adstock_weights()
a <- convolve_adstock_weights(x, w)

x[1:12]
#>  [1]    0.000 3731.596 2217.981    0.000 4274.270 2801.566 3329.304 2652.199
#>  [9] 3066.319 2415.696    0.000    0.000
a[1:12]
#>  [1]    0.0000 1866.2536 2042.3879 1021.1939 2648.2540 2725.2522 3027.6844
#>  [8] 2840.2657 2953.6667 2684.9764 1342.4882  671.2441