validate_forecast: Re-validate an existing forecast object

validate_forecastR Documentation

Re-validate an existing forecast object

Description

The function re-validates an existing forecast object. It is similar to assert_forecast(), but returns the input data instead of an invisible NULL. See as_forecast() for details on the expected input formats.

Usage

validate_forecast(forecast, forecast_type = NULL, verbose = TRUE)

Arguments

forecast

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

forecast_type

(optional) The forecast type you expect the forecasts to have. If the forecast type as determined by scoringutils based on the input does not match this, an error will be thrown. If NULL (the default), the forecast type will be inferred from the data.

verbose

Logical. If FALSE (default is TRUE), no messages and warnings will be created.

Value

Returns NULL invisibly.

Examples

forecast <- as_forecast_binary(example_binary)
assert_forecast(forecast)

epiforecasts/scoringutils documentation built on Sept. 29, 2024, 4:30 p.m.