metric_bias: Metric for Bias

Description Usage Arguments Details Value Recovery Use See Also Examples

View source: R/metrics.R

Description

Computes the Bias

Usage

1
metric_bias(estimate, oracle, na.rm = FALSE)

Arguments

estimate

Estimated values from the model.

oracle

Known values used to generate the model.

na.rm

A logical indicating if missing values (including NaN) should be removed. Default: FALSE

Details

The bias measures the difference between expected value of an estimated parameter and its true value.

The metric is computed under:

\operatorname{Bias}(\hat θ, θ) = E≤ft[\hatθ\right] - θ

Value

A numeric value for each parameter comparison.

Recovery Use

The bias may be used to understand the difference between \hatθ matrix and the oracle θ matrix.

See Also

base::norm()

Examples

1
2
3
4
5
6
# Construct data
estimate = matrix(c(1,1,2,4,3,6), nrow = 2, ncol = 3)
truth = matrix(c(1,2,3,4,5,6), nrow = 2, ncol = 3)

# Compute the bias
metric_bias(estimate, truth)

tmsalab/edmcore documentation built on Sept. 4, 2021, 2:46 a.m.