Learn R Programming

NeuralEstimators (version 0.2.0)

risk: computes a Monte Carlo approximation of an estimator's Bayes risk

Description

computes a Monte Carlo approximation of an estimator's Bayes risk

Usage

risk(
  assessment,
  loss = function(x, y) abs(x - y),
  average_over_parameters = FALSE,
  average_over_sample_sizes = TRUE
)

Value

a dataframe giving an estimate of the Bayes risk

Arguments

assessment

an object returned by assess()

loss

a binary operator defining the loss function (default absolute-error loss)

average_over_parameters

if TRUE, the loss is averaged over all parameters; otherwise (default), the loss is averaged over each parameter separately

average_over_sample_sizes

if TRUE (default), the loss is averaged over all sample sizes (the column m in df); otherwise, the loss is averaged over each sample size separately

See Also

assess(), bias(), rmse()