Skip to contents

Door EMA smoothing across units

Usage

door_ema(conn_counts, unit_row_indices, alpha = 0.1, segment_ids = integer())

Arguments

conn_counts

Numeric matrix of connection counts

unit_row_indices

List of integer vectors of row indices

alpha

Smoothing factor

segment_ids

Optional integer vector of segment IDs

Examples

counts <- matrix(c(10, 0,
                    0, 10,
                   10, 0,
                    0, 10), nrow = 4, byrow = TRUE)
door_ema(counts, list(c(0L, 1L), c(2L, 3L)), alpha = 0.5)
#>      [,1] [,2]
#> [1,]   10    0
#> [2,]    5    5
#> [3,]   10    0
#> [4,]    5    5