sample_to_quantile: Change data from a sample based format to a quantile format

View source: R/utils_data_handling.R

sample_to_quantileR Documentation

Change data from a sample based format to a quantile format

Description

Transform data from a format that is based on predictive samples to a format based on plain quantiles.

Usage

sample_to_quantile(
  forecast,
  quantile_level = c(0.05, 0.25, 0.5, 0.75, 0.95),
  type = 7
)

Arguments

forecast

A forecast object of class forecast_sample (a validated data.table with predicted and observed values, see as_forecast()).

quantile_level

A numeric vector of quantile levels for which quantiles will be computed.

type

Type argument passed down to the quantile function. For more information, see quantile().

Value

a data.table in a long interval range format

Examples

sample_to_quantile(as_forecast(example_sample_discrete))

epiforecasts/scoringutils documentation built on April 23, 2024, 4:56 p.m.