calculate_metrics {mbr}R Documentation

Reconstruction metrics

Description

Calculate reconstruction metrics from the instrumental period

Usage

calculate_metrics(sim, obs, z, norm.fun = mean)

Arguments

sim

A vector of reconstruction output for instrumental period

obs

A vector of all observations

z

A vector of left out indices in cross validation

norm.fun

The function (unquoted name) used to calculate the normalizing constant. Default is mean(), but other functions such as sd() can also be used. THe function must take a vector as input and return a scalar as output, and must have an argument na.rm = TRUE.

Value

A named vector of performance metrics

Examples

calculate_metrics(rnorm(100), rnorm(100), z = 1:10)
calculate_metrics(rnorm(100), rnorm(100), z = 1:10, norm.fun = sd)

[Package mbr version 0.0.1 Index]