# base variable; random draw from standard normal distribution
x <- rnorm(30)
# calibration thresholds
th <- quantile(x, seq(from = 0.1, to = 0.9, length = 5))
# calibration of binary-value crisp sets (two groups)
calibrate(x, thresholds = th[3])
# calibration of multi-value crisp set (three groups)
calibrate(x, thresholds = c(th[2], th[4]))
# fuzzy-set calibration (positive end-point concept, linear)
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[1], th[3], th[5])),
ylab = "Fuzzy Set Membership")
# fuzzy-set calibration (positive end-point concept, logistic)
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[1], th[3], th[5]),
logistic = TRUE, idm = 0.99), ylab = "Fuzzy Set Membership")
# fuzzy-set calibration (positive end-point concept, ECDF)
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[1], th[3], th[5]),
ecdf = TRUE), ylab = "Fuzzy Set Membership")
# fuzzy-set calibration (negative end-point concept, s-shaped)
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[5], th[3], th[1]),
p = 2, q = 2), ylab = "Fuzzy Set Membership")
# fuzzy-set calibration (positive mid-point concept, triangular)
plot(x, calibrate(x, type = "fuzzy", thresholds = th[c(1,2,3,3,4,5)]),
ylab = "Fuzzy Set Membership")
# fuzzy-set calibration (negative mid-point concept, bell-shaped)
plot(x, calibrate(x, type = "fuzzy", thresholds = th[c(3,2,1,5,4,3)],
p = 3, q = 3), ylab = "Fuzzy Set Membership")
Run the code above in your browser using DataLab