Skip to main content
Real time series arrive with gaps — sensor outages, weekend reporting holidays, dropped records. SynForecast injects missing values so you can test imputation and check that a model tolerates gaps rather than silently mishandling them. Three patterns cover the common shapes.
Choosing a pattern
  • "random" — points drop independently (transient dropouts).
  • "block" — contiguous runs go missing (outages); set missing_block_size.
  • "seasonal" — gaps recur on a cycle (e.g. weekends); set missing_seasonal_period.
missing_rate is the target fraction missing. Missing values appear as NaN in y; the plots below mark them with red ticks along the bottom.

Random gaps

Independent dropouts scattered through the series — the simplest pattern, and a reasonable default for unreliable feeds.

Block gaps (outages)

Real outages remove consecutive observations. missing_block_size sets the typical run length, so the same overall rate now arrives in a few long stretches instead of many isolated points.

Seasonal gaps (recurring holidays)

With missing_pattern="seasonal" gaps recur on a fixed cycle — the classic weekend-reporting gap on daily data (missing_seasonal_period=7).
The gaps concentrate on particular days of the week rather than spreading evenly — the breakdown below makes that concrete.

Rate and multiple series

missing_rate scales the amount missing, and each series in a panel gets its own independent gaps.
Related capabilities