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 2023)) - 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. 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 (P. Grzegorzewski and Romaniuk 2021, 2024; Przemyslaw Grzegorzewski and Romaniuk 2022)) from package (see (Romaniuk, Grzegorzewski, and Parchami 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.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.