| Title: | Intuitionistic Fuzzy Statistics |
|---|---|
| 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. |
| Authors: | Mukul Bijalwan [aut, cre] (ORCID: <https://orcid.org/0009-0001-3040-6912>), Gunjan Aggrwal [aut], Mukul Jain [aut] |
| Maintainer: | Mukul Bijalwan <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-10-21 12:10:44 UTC |
| Source: | https://github.com/cran/IFFuzzyStats |
Addition, multiplication, scalar multiplication and power for IFVs,
following Xu (2007): for , ,
:
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)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)
a, b
|
objects coercible to |
lambda |
positive numeric scalar or vector. |
Einstein variants use Einstein t-norm / t-conorm:
An ifv object.
Xu, Z. (2007). Intuitionistic fuzzy aggregation operators. IEEE Trans. Fuzzy Systems, 15(6), 1179-1187.
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)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
if_aggregate_matrix(mat, w, ncrit, fun = ifwa)if_aggregate_matrix(mat, w, ncrit, fun = ifwa)
mat |
|
w |
criterion weights. |
ncrit |
number of criteria (columns); rows of |
fun |
aggregation function, e.g. |
ifv vector (one fused value per alternative).
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)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
if_check(x, tol = 1e-09)if_check(x, tol = 1e-09)
x |
object coercible to |
tol |
numeric tolerance. |
invisibly TRUE; errors if invalid.
Complement of an IFV
if_comp(x)if_comp(x)
x |
object coercible to |
ifv with mu/nu swapped.
if_comp(ifv(0.6, 0.2))if_comp(ifv(0.6, 0.2))
Max-min / max-product composition of IF relations and the compositional rule of inference (Zadeh, 1973, extended to IFS).
if_compose(R, S, nx, ny, nz, op = c("maxmin", "maxprod"))if_compose(R, S, nx, ny, nz, op = c("maxmin", "maxprod"))
R, S
|
matrices (or data.frames) of IFVs stored as |
nx, ny, nz
|
dimensions. |
op |
|
An IF relation on is a matrix of IFVs. Composition
on is:
where 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).
An ifv vector of length nx*nz (row-major).
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)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
if_defuzzify(x, method = c("score", "expected", "accuracy", "mu"))if_defuzzify(x, method = c("score", "expected", "accuracy", "mu"))
x |
object coercible to |
method |
|
numeric vector.
if_defuzzify(ifv(c(0.6, 0.5), c(0.3, 0.2)))if_defuzzify(ifv(c(0.6, 0.5), c(0.3, 0.2)))
For sets of equal cardinality with elements
, :
if_dist( a, b, method = c("hamming", "euclidean", "hausdorff", "ye", "ye_cosine", "park"), w = NULL )if_dist( a, b, method = c("hamming", "euclidean", "hausdorff", "ye", "ye_cosine", "park"), w = NULL )
a, b
|
objects coercible to |
method |
distance name (partial matching allowed). |
w |
optional element weights. |
"hamming" (normalised Szmidt-Kacprzyk):
.
"euclidean" (normalised):
.
"hausdorff" (normalised Hamming-Hausdorff):
.
"ye" (Ye's modified Hamming-type distance):
.
"ye_cosine": where is Ye's cosine
similarity (see if_sim).
"park": normalised Hamming including hesitation
(same numeric form as "hamming" here).
Weighted versions: pass w (sums to 1) to weight elements:
with per-element .
numeric scalar distance.
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.
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")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")
Fuzziness / intuitionism of a set .
All measures lie in with larger = more fuzzy.
if_entropy(x, method = c("burillo", "szmidt", "vlachos", "zeng_li"))if_entropy(x, method = c("burillo", "szmidt", "vlachos", "zeng_li"))
x |
object coercible to |
method |
one of |
"burillo" (Burillo & Bustince, 1996):
.
"szmidt" (Szmidt & Kacprzyk, 2001):
(define ).
"vlachos" (Vlachos & Sergiadis, 2007; De Luca-Termini extension):
,
with .
"zeng_li" (Zeng & Li, 2006):
.
numeric scalar in .
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.
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")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")
Converts a numeric vector into IFVs by normalising into to
get membership, then deriving non-membership as
so hesitation absorbs the remainder.
Useful for feeding measurements into the IF toolkit.
if_fuzzify(x, mu_range = range(x, na.rm = TRUE), nu_ratio = 0.6)if_fuzzify(x, mu_range = range(x, na.rm = TRUE), nu_ratio = 0.6)
x |
numeric vector. |
mu_range |
range used to scale |
nu_ratio |
share of the non-membership part in |
ifv vector.
if_fuzzify(1:5) if_fuzzify(c(10, 20, 30), nu_ratio = 0.5)if_fuzzify(1:5) if_fuzzify(c(10, 20, 30), nu_ratio = 0.5)
Given a fact (IF set on X, length nx) and an IF implication
relation on (nx*ny values row-major), infer the
consequent on Y via max-min composition.
if_infer(fact, relation, nx, ny, op = c("maxmin", "maxprod"))if_infer(fact, relation, nx, ny, op = c("maxmin", "maxprod"))
fact |
|
relation |
|
nx, ny
|
dimensions. |
op |
composition operator. |
ifv of length ny.
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)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
if_pi(x)if_pi(x)
x |
an |
numeric vector of .
Rank alternatives from aggregated IFVs
if_rank_df(x, labels = NULL)if_rank_df(x, labels = NULL)
x |
object coercible to |
labels |
optional alternative labels. |
ranked data.frame.
if_rank_df(ifv(c(0.6, 0.5, 0.7), c(0.3, 0.2, 0.1)))if_rank_df(ifv(c(0.6, 0.5, 0.7), c(0.3, 0.2, 0.1)))
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.
if_rule_block(fact, relations, nx, ny, op = c("maxmin", "maxprod"))if_rule_block(fact, relations, nx, ny, op = c("maxmin", "maxprod"))
fact |
|
relations |
list of |
nx, ny
|
dimensions. |
op |
composition operator. |
ifv length ny.
Score , accuracy
(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).
if_score(x) if_accuracy(x) if_hesitation(x) if_rank(x) if_order(x) if_best(x)if_score(x) if_accuracy(x) if_hesitation(x) if_rank(x) if_order(x) if_best(x)
x |
object coercible to |
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).
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.
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)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)
Similarities in (larger = more similar), complementing
if_dist.
if_sim( a, b, method = c("chen", "hong_kim", "ye_cosine", "ye_weighted", "deng", "liang_shi", "dice"), w = NULL )if_sim( a, b, method = c("chen", "hong_kim", "ye_cosine", "ye_weighted", "deng", "liang_shi", "dice"), w = NULL )
a, b
|
objects coercible to |
method |
similarity name (partial matching allowed). |
w |
optional element weights. |
"chen": (one minus normalised Hamming).
"hong_kim": (one minus normalised Euclidean).
"ye_cosine" (Ye, 2011): weighted cosine
.
"ye_weighted" (Ye, 2010 correlation):
with
.
"deng" / "liang_shi": Jaccard-style
.
"dice": Dice-style
.
numeric scalar similarity in .
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.
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")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")
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 and negative
ideal using normalised Euclidean IF distance. Closeness
; larger is better.
if_topsis(mat, nalt, ncrit, w, dist = "euclidean", agg = ifwa)if_topsis(mat, nalt, ncrit, w, dist = "euclidean", agg = ifwa)
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 |
data.frame with columns alt, mu, nu,
score, d_plus, d_minus, closeness,
rank, ordered by rank.
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.
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))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))
Clusters ifv data with intuitionistic fuzzy memberships.
Distance between an observation and centre is the
normalised Euclidean IF distance (Szmidt-Kacprzyk). An optional
hesitation weight lambda inflates distances by
where is the mean
hesitation of the pair, emphasising uncertain points when
lambda > 0 (Xu et al. style modification).
ifcmeans( x, k, m = 2, lambda = 0, maxit = 100, tol = 1e-05, nstart = 1L, seed = NULL )ifcmeans( x, k, m = 2, lambda = 0, maxit = 100, tol = 1e-05, nstart = 1L, seed = NULL )
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. |
A list with centers (ifv, k rows),
membership (n x k matrix), cluster (hard labels),
within_ss (sum of weighted squared distances),
iter, converged.
Xu, Z., Chen, J. & Wu, J. (2008). Clustering algorithm for intuitionistic fuzzy sets. Information Sciences, 178(19), 3775-3790.
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$centersset.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
Lloyd-style k-means with normalised Euclidean IF distance and IFWA centroid updates.
ifkmeans(x, k, maxit = 50, nstart = 5L, seed = NULL)ifkmeans(x, k, maxit = 50, nstart = 5L, seed = NULL)
x |
object coercible to |
k |
number of clusters. |
maxit |
maximum iterations. |
nstart |
random starts. |
seed |
seed. |
list with centers (ifv), cluster,
within_ss, iter, converged.
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)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)
An intuitionistic fuzzy value is a pair with
, and .
Hesitation is .
ifv(mu, nu)ifv(mu, nu)
mu |
numeric vector of membership degrees in |
nu |
numeric vector of non-membership degrees in |
An object of class "ifv": a data.frame with columns
mu, nu, pi.
ifv(0.6, 0.3) ifv(c(0.5, 0.7), c(0.3, 0.1))ifv(0.6, 0.3) ifv(c(0.5, 0.7), c(0.3, 0.1))
Weighted / ordered / hybrid aggregation of IFVs after Xu (2007) and Xu & Yager (2006).
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)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)
x |
object coercible to |
w |
numeric weight vector (non-negative, sums to 1; normalised if not). |
order_w |
positional weights for ordered/hybrid operators. |
For IFVs with weights :
Ordered variants (IFOWA/IFOWG) first reorder by score
(descending) and then apply positional weights.
Hybrid variants (IFHA/IFHG) weight each by
(via scalar-mul / power) and then apply ordered weighting.
Terms arising from zero weights are treated as 1, and
-type products skip zero-weight factors, so unused inputs do
not affect the result.
A single-row ifv.
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.
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))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
is_ifv(x) as_ifv(x, ...)is_ifv(x) as_ifv(x, ...)
x |
object to test or coerce. |
... |
ignored. |
is_ifv() logical; as_ifv() an ifv object.