evaliq {misspi} | R Documentation |
Evaluate the Imputation Quality
Description
Calculates Root Mean Squared Error (RMSE), Mean Absolute Error (MAE) and Normalized Root Mean Squared Error (NRMSE). It also performs visualization for imputation quality evaluation.
Usage
evaliq(x.true, x.impute, plot = TRUE, interactive = FALSE)
Arguments
x.true |
a vector with true values. |
x.impute |
a vector with estimated values. |
plot |
a Boolean that indicates whether to plot or not. |
interactive |
a Boolean that indicates whether to use interactive plot when the plot option is invoked (plot = "TRUE"). |
Value
rmse root mean squared error.
mae mean absolute error.
nrmse normalized root mean squared error.
Author(s)
Zhongli Jiang jiang548@purdue.edu
See Also
Examples
# A very quick example
n <- 100
x.true <- rnorm(n)
x.est <- x.true
na.idx <- sample(1:n, 20)
x.est[na.idx] <- x.est[na.idx] + rnorm(length(na.idx), sd = 0.1)
# Default plot
er.eval <- evaliq(x.true[na.idx], x.est[na.idx])
# Interactive plot
er.eval <- evaliq(x.true[na.idx], x.est[na.idx], interactive = TRUE)
# Turn off plot
# All of the three case will return the value of error
er.eval <- evaliq(x.true[na.idx], x.est[na.idx], plot = FALSE)
er.eval
# Real data example
set.seed(0)
data(toxicity, package = "misspi")
toxicity.miss <- missar(toxicity, 0.4, 0.2)
impute.res <- misspi(toxicity.miss)
x.imputed <- impute.res$x.imputed
na.idx <- which(is.na(toxicity.miss))
evaliq(toxicity[na.idx], x.imputed[na.idx])
evaliq(toxicity[na.idx], x.imputed[na.idx], interactive = TRUE)
[Package misspi version 0.1.0 Index]