piecewise_steps: Calculate piecewise steps

View source: R/utils.R

piecewise_stepsR Documentation

Calculate piecewise steps

Description

This helper function streamlines the calculation of piecewise steps. This may be useful when specifying random walks, AR processes, etc.

Usage

piecewise_steps(t, step, offset = 0, steps_post_offset = TRUE)

Arguments

t

Integer, the timespan over which to calculate steps

step

Integer, the frequency at which to step.

offset

Integer, the amount to offset steps. This can be used to index steps from this index.

steps_post_offset

Logical, defaults to TRUE. Should steps be added after the offset.

Value

A list containing two elements: n (the number of steps) and steps the location of steps as a binary variable.

See Also

Preprocessing functions filter_by_availability(), fv_dow_period(), latest_obs()


epiforecasts/forecast.vocs documentation built on May 14, 2023, 2 p.m.