View source: R/calc_nmse_from_identity_line.R
calc_nmse_from_identity_line | R Documentation |
Calculate the normalized mean squared error from the identity line
(i.e. the line y = x
).
If the estimated values are equal to the true values, the MSE is zero.
calc_nmse_from_identity_line(true_values, estimated_values)
true_values |
the true values |
estimated_values |
the estimated values |
the mean squared error from the identity line
Richèl J.C. Bilderbeek
use calc_mse_from_identity_line to calculate the (un-normalized) mean square error from the identity line
true_values_degrees <- seq(1, 360)
estimated_values_degrees <- true_values_degrees + stats::runif(n = 360)
nmse_degrees <- calc_nmse_from_identity_line(
true_values = true_values_degrees,
estimated_values = estimated_values_degrees
)
nmse_degrees
# Convert degrees to radians
true_values_radians <- 2.0 * pi * true_values_degrees / 360
estimated_values_radians <- 2.0 * pi * estimated_values_degrees / 360
nmse_radians <- calc_nmse_from_identity_line(
true_values = true_values_radians,
estimated_values = estimated_values_radians
)
nmse_radians
# mse_degrees and mse_radians are the same, due to their normalized scales
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.