se_mean_sample: Squared error of the mean (sample-based version)

View source: R/metrics-sample.R

se_mean_sampleR Documentation

Squared error of the mean (sample-based version)

Description

Squared error of the mean calculated as

\textrm{mean}(\textrm{observed} - \textrm{mean prediction})^2

The mean prediction is calculated as the mean of the predictive samples.

Usage

se_mean_sample(observed, predicted)

Arguments

observed

A vector with observed values of size n

predicted

nxN matrix of predictive samples, n (number of rows) being the number of data points and N (number of columns) the number of Monte Carlo samples. Alternatively, predicted can just be a vector of size n.

Input format

metrics-sample.png

Overview of required input format for sample-based forecasts

Examples

observed <- rnorm(30, mean = 1:30)
predicted_values <- matrix(rnorm(30, mean = 1:30))
se_mean_sample(observed, predicted_values)

epiforecasts/scoringutils documentation built on Dec. 11, 2024, 11:12 a.m.