Skip to contents

Score a forecast against some observations using a given scoring function. Additional parameters can be passed along to the scoring function.

Usage

score(fcsts, obs, fun, ...)

Arguments

fcsts

A single forecast object, or a list of forecast objects

obs

An observations data frame

fun

A scoring function. fcst and obs will be passed to it

...

Additional parameters which will be passed along to fun

Value

If fcsts is a forecast object, a single score will be returned. If fcsts is a list of forecast objects, then a list of scores will be returned.

Details

See vignette("scoring") for a complete list of scoring functions available, along with the details of their use. s

Examples

fc1 <- create_forecast(data.frame(time=1:5, val=6:10))
fc2 <- create_forecast(data.frame(time=1:5, val=7:11))

obs <- data.frame(time=1:5, val_obs=c(8,8,8,8,8))

score(fc1, obs, bias)
#> [1] 0
score(fc2, obs, bias)
#> [1] 0.4
score(list(fc1, fc2), obs, bias)
#> [[1]]
#> [1] 0
#> 
#> [[2]]
#> [1] 0.4
#>