| Type: | Package |
| Title: | Intuitionistic Fuzzy Statistics |
| Version: | 0.1.0 |
| Maintainer: | Mukul Bijalwan <mukulbijalwan555@gmail.com> |
| Description: | Provides constructors and arithmetic for intuitionistic fuzzy values (intuitionistic fuzzy value, IFV) for intuitionistic fuzzy sets (Atanassov (1986) <doi:10.1016/S0165-0114(86)80034-3>), including aggregation operators of Xu (2007) <doi:10.1109/TFUZZ.2006.890678> and Xu and Yager (2006) <doi:10.1080/03081070600574353>: intuitionistic fuzzy weighted averaging (IFWA), intuitionistic fuzzy weighted geometric (IFWG), intuitionistic fuzzy ordered weighted averaging (IFOWA), intuitionistic fuzzy ordered weighted geometric (IFOWG), intuitionistic fuzzy hybrid averaging (IFHA), intuitionistic fuzzy hybrid geometric (IFHG), and Einstein operators; entropy (Szmidt and Kacprzyk (2000) <doi:10.1016/S0165-0114(98)00402-3>; Vlachos and Sergiadis (2007) <doi:10.1016/j.patrec.2006.07.004>) and distance and similarity measures, including Ye (2011) <doi:10.1016/j.mcm.2010.07.022> cosine similarity and Hamming, Euclidean and Hausdorff distances; intuitionistic fuzzy c-means and k-means clustering; approximate reasoning via compositional inference; and multi-criteria decision support via intuitionistic fuzzy Technique for Order of Preference by Similarity to Ideal Solution (IF-TOPSIS) (Boran et al. (2009) <doi:10.1016/j.eswa.2009.03.039>) and score ranking. All computations use only base R with fully vectorised implementations. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| URL: | https://github.com/MukulBijalwan/IFFuzzyStats |
| BugReports: | https://github.com/MukulBijalwan/IFFuzzyStats/issues |
| NeedsCompilation: | no |
| Config/roxygen2/version: | 8.1.0 |
| Packaged: | 2026-10-09 05:37:41 UTC; Admin |
| Author: | Mukul Bijalwan |
| Repository: | CRAN |
| Date/Publication: | 2026-10-21 08:40:24 UTC |
Intuitionistic Fuzzy Statistics Toolkit
Description
A comprehensive toolkit for intuitionistic fuzzy sets (Atanassov, 1986),
where each element carries membership \mu, non-membership \nu
and hesitation \pi = 1 - \mu - \nu. Provides constructors and
arithmetic, Xu/Yager aggregation operators, entropy and similarity
measures, fuzzy clustering, compositional inference, and IF-TOPSIS.
References
Atanassov, K. (1986). Intuitionistic fuzzy sets. Fuzzy Sets and Systems, 20(1), 87-96. Xu, Z. (2007). Intuitionistic fuzzy aggregation operators. IEEE Trans. Fuzzy Systems, 15(6), 1179-1187. Szmidt, E. & Kacprzyk, J. (2000). Distances between intuitionistic fuzzy sets. Fuzzy Sets and Systems, 114(3), 505-518.
Intuitionistic fuzzy arithmetic (Xu operations)
Description
Addition, multiplication, scalar multiplication and power for IFVs,
following Xu (2007): for a=(\mu_a,\nu_a), b=(\mu_b,\nu_b),
\lambda>0:
a\oplus b=(\mu_a+\mu_b-\mu_a\mu_b,\ \nu_a\nu_b)
a\otimes b=(\mu_a\mu_b,\ \nu_a+\nu_b-\nu_a\nu_b)
\lambda a=(1-(1-\mu_a)^\lambda,\ \nu_a^\lambda)
a^\lambda=(\mu_a^\lambda,\ 1-(1-\nu_a)^\lambda)
Usage
if_add(a, b)
if_mul(a, b)
if_scalar_mul(lambda, a)
if_pow(a, lambda)
if_einstein_add(a, b)
if_einstein_mul(a, b)
if_einstein_scalar_mul(lambda, a)
if_einstein_pow(a, lambda)
Arguments
a, b |
objects coercible to |
lambda |
positive numeric scalar or vector. |
Details
Einstein variants use Einstein t-norm / t-conorm:
a\oplus_\epsilon b=
\left(\frac{\mu_a+\mu_b}{1+\mu_a\mu_b},
\frac{\nu_a\nu_b}{1+(1-\nu_a)(1-\nu_b)}\right)
a\otimes_\epsilon b=
\left(\frac{\mu_a\mu_b}{1+(1-\mu_a)(1-\mu_b)},
\frac{\nu_a+\nu_b}{1+\nu_a\nu_b}\right)
Value
An ifv object.
References
Xu, Z. (2007). Intuitionistic fuzzy aggregation operators. IEEE Trans. Fuzzy Systems, 15(6), 1179-1187.
Examples
a <- ifv(0.6, 0.3); b <- ifv(0.5, 0.3)
if_add(a, b); if_mul(a, b); if_scalar_mul(2, a); if_pow(a, 2)
Aggregate rows of an IF decision matrix
Description
Aggregate rows of an IF decision matrix
Usage
if_aggregate_matrix(mat, w, ncrit, fun = ifwa)
Arguments
mat |
|
w |
criterion weights. |
ncrit |
number of criteria (columns); rows of |
fun |
aggregation function, e.g. |
Value
ifv vector (one fused value per alternative).
Examples
m <- ifv(c(0.6, 0.5, 0.7, 0.4), c(0.2, 0.3, 0.1, 0.4))
# 2 alternatives x 2 criteria stored row-wise:
if_aggregate_matrix(m, w = c(0.6, 0.4), ncrit = 2, fun = ifwa)
Validate IFVs
Description
Validate IFVs
Usage
if_check(x, tol = 1e-09)
Arguments
x |
object coercible to |
tol |
numeric tolerance. |
Value
invisibly TRUE; errors if invalid.
Complement of an IFV
Description
Complement of an IFV
Usage
if_comp(x)
Arguments
x |
object coercible to |
Value
ifv with mu/nu swapped.
Examples
if_comp(ifv(0.6, 0.2))
Intuitionistic fuzzy relations: composition and inference
Description
Max-min / max-product composition of IF relations and the compositional rule of inference (Zadeh, 1973, extended to IFS).
Usage
if_compose(R, S, nx, ny, nz, op = c("maxmin", "maxprod"))
Arguments
R, S |
matrices (or data.frames) of IFVs stored as |
nx, ny, nz |
dimensions. |
op |
|
Details
An IF relation on X \times Y is a matrix of IFVs. Composition
R \circ S on X \times Z is:
(R \circ S)(x,z) =
\bigoplus_{y} (R(x,y) \otimes S(y,z))
where \oplus,\otimes are max-min (default) or max-product.
Membership composes with t-conorm over t-norm, non-membership with the
dual operation (min over max for max-min; product-sum dual for max-product).
Value
An ifv vector of length nx*nz (row-major).
Examples
R <- ifv(c(0.6, 0.3, 0.8, 0.2), c(0.2, 0.5, 0.1, 0.6)) # 2x2
S <- ifv(c(0.5, 0.7, 0.4, 0.9), c(0.3, 0.1, 0.4, 0.0)) # 2x2
if_compose(R, S, nx = 2, ny = 2, nz = 2)
Defuzzify IFVs to crisp scores
Description
Defuzzify IFVs to crisp scores
Usage
if_defuzzify(x, method = c("score", "expected", "accuracy", "mu"))
Arguments
x |
object coercible to |
method |
|
Value
numeric vector.
Examples
if_defuzzify(ifv(c(0.6, 0.5), c(0.3, 0.2)))
Distances between intuitionistic fuzzy sets
Description
For sets A,B of equal cardinality n with elements
(\mu^A_i,\nu^A_i,\pi^A_i), (\mu^B_i,\nu^B_i,\pi^B_i):
Usage
if_dist(
a,
b,
method = c("hamming", "euclidean", "hausdorff", "ye", "ye_cosine", "park"),
w = NULL
)
Arguments
a, b |
objects coercible to |
method |
distance name (partial matching allowed). |
w |
optional element weights. |
Details
-
"hamming"(normalised Szmidt-Kacprzyk):\frac{1}{2n}\sum(|\Delta\mu|+|\Delta\nu|+|\Delta\pi|). -
"euclidean"(normalised):\sqrt{\frac{1}{2n}\sum((\Delta\mu)^2+(\Delta\nu)^2+(\Delta\pi)^2)}. -
"hausdorff"(normalised Hamming-Hausdorff):\frac{1}{n}\sum\max(|\Delta\mu|,|\Delta\nu|,|\Delta\pi|). -
"ye"(Ye's modified Hamming-type distance):\sum w_i \frac{|\Delta\mu_i|+|\Delta\nu_i|} {|\Delta\mu_i|+|\Delta\nu_i| +\min(\mu^A_i,\mu^B_i)+\min(\nu^A_i,\nu^B_i) +\min(\pi^A_i,\pi^B_i)+1}. -
"ye_cosine":1 - S_CwhereS_Cis Ye's cosine similarity (seeif_sim). -
"park": normalised Hamming including hesitation (same numeric form as"hamming"here).
Weighted versions: pass w (sums to 1) to weight elements:
D_w=\sum w_i d_i with per-element d_i.
Value
numeric scalar distance.
References
Szmidt, E. & Kacprzyk, J. (2000). Distances between intuitionistic fuzzy sets. Fuzzy Sets and Systems, 114(3), 505-518.
Ye, J. (2012). Multicriteria decision-making method using the Dice similarity measure based on the reduct intuitionistic fuzzy sets of interval-valued intuitionistic fuzzy sets. Applied Mathematical Modelling, 36(9), 4466-4472.
Examples
a <- ifv(c(0.6, 0.5), c(0.3, 0.2)); b <- ifv(c(0.5, 0.4), c(0.3, 0.3))
if_dist(a, b, "hamming"); if_dist(a, b, "euclidean"); if_dist(a, b, "hausdorff")
Entropy of intuitionistic fuzzy sets
Description
Fuzziness / intuitionism of a set A=\{a_1,\dots,a_n\}.
All measures lie in [0,1] with larger = more fuzzy.
Usage
if_entropy(x, method = c("burillo", "szmidt", "vlachos", "zeng_li"))
Arguments
x |
object coercible to |
method |
one of |
Details
-
"burillo"(Burillo & Bustince, 1996):E = \frac{1}{n}\sum \pi_i. -
"szmidt"(Szmidt & Kacprzyk, 2001):E = \frac{1}{n}\sum \frac{\min(\mu_i,\nu_i)+\pi_i}{\max(\mu_i,\nu_i)+\pi_i}(define0/0:=1). -
"vlachos"(Vlachos & Sergiadis, 2007; De Luca-Termini extension):E = \frac{-1}{n\ln 2}\sum [\mu_i\ln\mu_i+\nu_i\ln\nu_i-(1-\pi_i)\ln(1-\pi_i)-\pi_i\ln 2], with0\ln 0:=0. -
"zeng_li"(Zeng & Li, 2006):E = \frac{1}{n}\sum (1-|\mu_i-\nu_i|).
Value
numeric scalar in [0,1].
References
Burillo, P. & Bustince, H. (1996). Entropy on intuitionistic fuzzy sets and on interval-valued fuzzy sets. Fuzzy Sets and Systems, 78(3), 305-316.
Szmidt, E. & Kacprzyk, J. (2001). Entropy for intuitionistic fuzzy sets. Fuzzy Sets and Systems, 118(3), 467-477.
Vlachos, I. K. & Sergiadis, G. D. (2007). Intuitionistic fuzzy information - applications to pattern recognition. Pattern Recognition Letters, 28(2), 197-206.
Zeng, L. & Li, H. (2006). Normalized distance, similarity measure, intuitionistic fuzzy entropy and application. Proc. World Congress on Intelligent Control and Automation, 3857-3860.
Examples
x <- ifv(c(0.5, 0.6, 0.4), c(0.3, 0.2, 0.4))
if_entropy(x, "burillo"); if_entropy(x, "szmidt")
if_entropy(x, "vlachos"); if_entropy(x, "zeng_li")
Fuzzify numeric data into intuitionistic fuzzy values
Description
Converts a numeric vector into IFVs by normalising into [0,1] to
get membership, then deriving non-membership as
\nu = (1-\mu)\times \nu\_ratio so hesitation absorbs the remainder.
Useful for feeding measurements into the IF toolkit.
Usage
if_fuzzify(x, mu_range = range(x, na.rm = TRUE), nu_ratio = 0.6)
Arguments
x |
numeric vector. |
mu_range |
range used to scale |
nu_ratio |
share of the non-membership part in |
Value
ifv vector.
Examples
if_fuzzify(1:5)
if_fuzzify(c(10, 20, 30), nu_ratio = 0.5)
Compositional rule of inference for IFVs
Description
Given a fact (IF set on X, length nx) and an IF implication
relation on X \times Y (nx*ny values row-major), infer the
consequent on Y via max-min composition.
Usage
if_infer(fact, relation, nx, ny, op = c("maxmin", "maxprod"))
Arguments
fact |
|
relation |
|
nx, ny |
dimensions. |
op |
composition operator. |
Value
ifv of length ny.
Examples
fact <- ifv(c(0.8, 0.2), c(0.1, 0.7))
rel <- ifv(c(0.6, 0.3, 0.8, 0.2), c(0.2, 0.5, 0.1, 0.6))
if_infer(fact, rel, nx = 2, ny = 2)
Hesitation degree
Description
Hesitation degree
Usage
if_pi(x)
Arguments
x |
an |
Value
numeric vector of \pi = 1 - \mu - \nu.
Rank alternatives from aggregated IFVs
Description
Rank alternatives from aggregated IFVs
Usage
if_rank_df(x, labels = NULL)
Arguments
x |
object coercible to |
labels |
optional alternative labels. |
Value
ranked data.frame.
Examples
if_rank_df(ifv(c(0.6, 0.5, 0.7), c(0.3, 0.2, 0.1)))
Mamdani-style IF rule block evaluation
Description
Evaluate nrules rules, each mapping an nx-vector input fact
through its own nx*ny relation, then aggregate consequents by
element-wise max (mu) / min (nu) union.
Usage
if_rule_block(fact, relations, nx, ny, op = c("maxmin", "maxprod"))
Arguments
fact |
|
relations |
list of |
nx, ny |
dimensions. |
op |
composition operator. |
Value
ifv length ny.
Score, accuracy and ranking of IFVs
Description
Score S=\mu-\nu \in [-1,1], accuracy H=\mu+\nu \in [0,1]
(Chen & Tan, 1994; Hong & Choi, 2000). Ranking is lexicographic:
larger score first, ties broken by larger accuracy, then larger
hesitation-handling via tie = "pi_min" (smaller hesitation wins).
Usage
if_score(x)
if_accuracy(x)
if_hesitation(x)
if_rank(x)
if_order(x)
if_best(x)
Arguments
x |
object coercible to |
Value
if_score()/if_accuracy()/if_hesitation()
numeric vectors; if_rank() integer ranks (1 = best);
if_order() ordering permutation (best first);
if_best() best element(s).
References
Chen, S. M. & Tan, J. M. (1994). Handling multicriteria fuzzy decision-making problems based on vague set theory. Fuzzy Sets and Systems, 67(2), 163-172.
Hong, D. H. & Choi, C.-H. (2000). Multicriteria fuzzy decision-making problems based on vague set theory. Fuzzy Sets and Systems, 114(1), 103-113.
Examples
x <- ifv(c(0.6, 0.5, 0.7), c(0.3, 0.2, 0.1))
if_score(x); if_accuracy(x); if_rank(x); if_order(x)
Similarity between intuitionistic fuzzy sets
Description
Similarities in [0,1] (larger = more similar), complementing
if_dist.
Usage
if_sim(
a,
b,
method = c("chen", "hong_kim", "ye_cosine", "ye_weighted", "deng", "liang_shi", "dice"),
w = NULL
)
Arguments
a, b |
objects coercible to |
method |
similarity name (partial matching allowed). |
w |
optional element weights. |
Details
-
"chen":1 - D_H(one minus normalised Hamming). -
"hong_kim":1 - D_E(one minus normalised Euclidean). -
"ye_cosine"(Ye, 2011): weighted cosineS_C=\sum w_i \frac{\mu_A\mu_B+\nu_A\nu_B+\pi_A\pi_B} {\sqrt{\mu_A^2+\nu_A^2+\pi_A^2}\sqrt{\mu_B^2+\nu_B^2+\pi_B^2}}. -
"ye_weighted"(Ye, 2010 correlation):S_W=\frac{C(A,B)}{\max(C(A,A),C(B,B))}withC(A,B)=\sum w_i(\mu_A\mu_B+\nu_A\nu_B+\pi_A\pi_B). -
"deng"/"liang_shi": Jaccard-styleS_J=\sum w_i \frac{\mu_A\mu_B+\nu_A\nu_B+\pi_A\pi_B} {(\mu_A^2+\nu_A^2+\pi_A^2)+(\mu_B^2+\nu_B^2+\pi_B^2) -(\mu_A\mu_B+\nu_A\nu_B+\pi_A\pi_B)}. -
"dice": Dice-styleS_D=\sum w_i \frac{2(\mu_A\mu_B+\nu_A\nu_B+\pi_A\pi_B)} {(\mu_A^2+\nu_A^2+\pi_A^2)+(\mu_B^2+\nu_B^2+\pi_B^2)}.
Value
numeric scalar similarity in [0,1].
References
Ye, J. (2011). Cosine similarity measures for intuitionistic fuzzy sets and their applications. Mathematical and Computer Modelling, 53(1-2), 91-97.
Ye, J. (2010). Fuzzy decision-making method based on the weighted correlation coefficient under intuitionistic fuzzy environment. European J. Operational Research, 205(1), 202-204.
Liang, Z. & Shi, P. (2003). Similarity measures on intuitionistic fuzzy sets. Pattern Recognition Letters, 24(15), 2687-2693.
Examples
a <- ifv(c(0.6, 0.5), c(0.3, 0.2)); b <- ifv(c(0.5, 0.4), c(0.3, 0.3))
if_sim(a, b, "chen"); if_sim(a, b, "ye_cosine"); if_sim(a, b, "dice")
Intuitionistic fuzzy TOPSIS and decision helpers
Description
IF-TOPSIS after Boran et al. (2009): aggregate each alternative's
criterion IFVs with weights w (via ifwa by default), then
measure separation from the positive ideal A^+=(1,0) and negative
ideal A^-=(0,1) using normalised Euclidean IF distance. Closeness
C_i = D^-_i/(D^+_i+D^-_i); larger is better.
Usage
if_topsis(mat, nalt, ncrit, w, dist = "euclidean", agg = ifwa)
Arguments
mat |
|
nalt, ncrit |
dimensions (guessed from square if missing is impossible, so both are required). |
w |
criterion weights (length |
dist |
distance method passed to |
agg |
aggregation function (default |
Value
data.frame with columns alt, mu, nu,
score, d_plus, d_minus, closeness,
rank, ordered by rank.
References
Boran, F. E., Genc, S., Kurt, M. & Akay, D. (2009). A multi-criteria intuitionistic fuzzy group decision making for supplier selection with TOPSIS method. Expert Systems with Applications, 36(8), 11363-11368.
Examples
m <- ifv(c(0.6, 0.5, 0.7, 0.4, 0.5, 0.6), c(0.2, 0.3, 0.1, 0.4, 0.3, 0.2))
if_topsis(m, nalt = 3, ncrit = 2, w = c(0.6, 0.4))
Intuitionistic fuzzy c-means (IFCM) clustering
Description
Clusters ifv data with intuitionistic fuzzy memberships.
Distance between an observation a and centre v is the
normalised Euclidean IF distance (Szmidt-Kacprzyk). An optional
hesitation weight lambda inflates distances by
\exp(\lambda \cdot \bar\pi) where \bar\pi is the mean
hesitation of the pair, emphasising uncertain points when
lambda > 0 (Xu et al. style modification).
Usage
ifcmeans(
x,
k,
m = 2,
lambda = 0,
maxit = 100,
tol = 1e-05,
nstart = 1L,
seed = NULL
)
Arguments
x |
object coercible to |
k |
number of clusters. |
m |
fuzzifier > 1 (default 2). |
lambda |
hesitation penalty >= 0 (default 0 = plain IFCM). |
maxit |
maximum iterations. |
tol |
convergence tolerance on membership change. |
nstart |
number of random starts (best kept). |
seed |
random seed. |
Value
A list with centers (ifv, k rows),
membership (n x k matrix), cluster (hard labels),
within_ss (sum of weighted squared distances),
iter, converged.
References
Xu, Z., Chen, J. & Wu, J. (2008). Clustering algorithm for intuitionistic fuzzy sets. Information Sciences, 178(19), 3775-3790.
Examples
set.seed(1)
mu <- runif(30, 0.3, 0.7); nu <- runif(30, 0.05, 0.25)
x <- ifv(mu, nu)
r <- ifcmeans(x, k = 2, nstart = 2)
r$cluster; r$centers
Intuitionistic fuzzy k-means (hard labels, IF centroids)
Description
Lloyd-style k-means with normalised Euclidean IF distance and IFWA centroid updates.
Usage
ifkmeans(x, k, maxit = 50, nstart = 5L, seed = NULL)
Arguments
x |
object coercible to |
k |
number of clusters. |
maxit |
maximum iterations. |
nstart |
random starts. |
seed |
seed. |
Value
list with centers (ifv), cluster,
within_ss, iter, converged.
Examples
set.seed(2)
mu <- runif(20, 0.2, 0.7); nu <- runif(20, 0.0, 0.25)
x <- ifv(mu, nu)
ifkmeans(x, k = 2, nstart = 2)
Create an intuitionistic fuzzy value (IFV)
Description
An intuitionistic fuzzy value is a pair (\mu, \nu) with
\mu \ge 0, \nu \ge 0 and \mu + \nu \le 1.
Hesitation is \pi = 1 - \mu - \nu.
Usage
ifv(mu, nu)
Arguments
mu |
numeric vector of membership degrees in |
nu |
numeric vector of non-membership degrees in |
Value
An object of class "ifv": a data.frame with columns
mu, nu, pi.
Examples
ifv(0.6, 0.3)
ifv(c(0.5, 0.7), c(0.3, 0.1))
Intuitionistic fuzzy aggregation operators
Description
Weighted / ordered / hybrid aggregation of IFVs after Xu (2007) and Xu & Yager (2006).
Usage
ifwa(x, w)
ifwg(x, w)
ifowa(x, order_w)
ifowg(x, order_w)
ifha(x, w, order_w)
ifhg(x, w, order_w)
if_einstein_wa(x, w)
if_einstein_wg(x, w)
Arguments
x |
object coercible to |
w |
numeric weight vector (non-negative, sums to 1; normalised if not). |
order_w |
positional weights for ordered/hybrid operators. |
Details
For IFVs a_j=(\mu_j,\nu_j) with weights w_j:
IFWA = \left(1-\prod(1-\mu_j)^{w_j},\ \prod \nu_j^{w_j}\right)
IFWG = \left(\prod \mu_j^{w_j},\ 1-\prod(1-\nu_j)^{w_j}\right)
Ordered variants (IFOWA/IFOWG) first reorder a_j by score
S=\mu-\nu (descending) and then apply positional weights.
Hybrid variants (IFHA/IFHG) weight each a_j by n w_j
(via scalar-mul / power) and then apply ordered weighting.
Terms 0^0 arising from zero weights are treated as 1, and
0^0-type products skip zero-weight factors, so unused inputs do
not affect the result.
Value
A single-row ifv.
References
Xu, Z. (2007). Intuitionistic fuzzy aggregation operators. IEEE Trans. Fuzzy Systems, 15(6), 1179-1187.
Xu, Z. & Yager, R. R. (2006). Some geometric aggregation operators based on intuitionistic fuzzy sets. Int. J. General Systems, 35(4), 417-433.
Examples
x <- ifv(c(0.6, 0.5, 0.7), c(0.3, 0.2, 0.1))
ifwa(x, c(0.5, 0.3, 0.2))
ifwg(x, c(0.5, 0.3, 0.2))
ifowa(x, c(0.5, 0.3, 0.2))
Test / coerce intuitionistic fuzzy values
Description
Test / coerce intuitionistic fuzzy values
Usage
is_ifv(x)
as_ifv(x, ...)
Arguments
x |
object to test or coerce. |
... |
ignored. |
Value
is_ifv() logical; as_ifv() an ifv object.