Computes the Bias

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

Value

A numeric value for each parameter comparison.

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 \theta, \theta) = E\left[\hat\theta\right] - \theta$$

Recovery Use

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

See also

Examples

# 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)
#> [,1] [,2] [,3] #> [1,] 1.8333333 -0.1666667 -2.166667 #> [2,] 0.8333333 -1.1666667 -3.166667