Learn R Programming

mitey (version 0.2.0)

smooth_estimates: Apply Moving Average Smoothing to R Estimates

Description

Applies temporal smoothing to reproduction number estimates using a centered moving average window. Handles missing and infinite values appropriately.

Usage

smooth_estimates(r_estimate, window)

Value

numeric vector; smoothed reproduction number estimates of the same length as input. Returns NA for points with insufficient valid neighboring values

Arguments

r_estimate

numeric vector; reproduction number estimates to smooth. Can contain NA or infinite values

window

integer; size of the smoothing window in time units. Window is centered around each point