The goal of FuzzyImputationTest is to impute (i.e., replace missing values given by NAs) dataset that consists of triangular or trapezoidal fuzzy numbers, and check quality of such an imputation. To impute fuzzy values, various imputation methods - both general (like miceRanger, missingForest, knn), and specific ones (d-imputation method, abbreviated as DIMP, see (Romaniuk and Grzegorzewski 2026)) - can be used. To check the quality of the imputation process, the dataset without missing values can be specified, and then it is tested with the whole set of procedures (see (Romaniuk and Grzegorzewski 2026; Romaniuk 2026)). These procedures are related to calculation of various sample statistics like the mean, standard deviation, and some special distance measures for fuzzy numbers, together with obtaining different error values, and conduction of statistical tests based on the epistemic bootstrap (see (Grzegorzewski and Romaniuk 2021, 2024; Grzegorzewski and Romaniuk 2022)) from FuzzySimRes package (see (Romaniuk et al. 2024)). There are also special procedures to fuzzify the input and introduce some NAs when necessary.
The following procedures are available in the library:
You can install the development version of FuzzyImputationTest from GitHub with:
library(devtools)
install_github("mroman-ibs/FuzzyImputationTest")
# seed PRNG
set.seed(1234)
# load the necessary library
library(FuzzySimRes)
# generate sample of trapezoidal fuzzy numbers with FuzzySimRes library
list1<-SimulateSample(20,originalPD="rnorm",parOriginalPD=list(mean=0,sd=1),
incrCorePD="rexp", parIncrCorePD=list(rate=2),
suppLeftPD="runif",parSuppLeftPD=list(min=0,max=0.6),
suppRightPD="runif", parSuppRightPD=list(min=0,max=0.6),
type="trapezoidal")
# convert fuzzy data into a matrix
matrix1 <- FuzzyNumbersToMatrix(list1$value)
# check starting values
head(matrix1)
# add some NAs to the matrix
matrix1NA <- IntroducingNA(matrix1,percentage = 0.1)
head(matrix1NA)
# impute missing values with the DIMP method
set.seed(12345)
FuzzyImputation(matrix1NA)
# impute missing values with the miceRanger method
set.seed(12345)
FuzzyImputation(matrix1NA,method = "miceRanger")
# compare imputation methods
set.seed(123456)
MethodsComparison(matrix1,iterations=10,matrix1Mask,trapezoidal=TRUE)For additional examples check the help files please.