construct_rolling_infrastructure: Build a Rolling Infraestructure

View source: R/construct_rolling_infrastructure.R

construct_rolling_infrastructureR Documentation

Build a Rolling Infraestructure

Description

Constructs a tidy-resampling object for time-series data.

Usage

construct_rolling_infrastructure(
  .data,
  .initial = 252,
  .assess = 1,
  .cumulative = FALSE,
  ...
)

Arguments

.data

A tabular (non-tidy) tibble.

.initial

A integer. The number of samples used for analysis/modeling in the initial resample.

.assess

A integer. The number of samples used for each assessment resample.

.cumulative

A boolean. Should the analysis resample grow beyond the size specified by .initial at each resample?.

...

Additional arguments to be passed to rolling_origin.

Value

A tibble of the snoop_rolling class. Contains 3 columns: .date, .analysis and .assessment.

Examples

stocks <- tibble::tibble(
  time = as.Date('2009-01-01') + 0:99,
  X    = rnorm(100, 0, 1),
  Y    = rnorm(100, 0, 2),
  Z    = rnorm(100, 0, 4)
)

construct_rolling_infrastructure(stocks, .initial = 50)

Reckziegel/snoop documentation built on July 1, 2022, 5:32 a.m.