Learn R Programming

QCA (version 1.0-4)

calibrate: Calibrate Crisp (Binary or Multi-Value) and Fuzzy Sets

Description

This function produces crisp and fuzzy sets from raw data (base variables) and some specified threshold(s). The calibration of fuzzy sets is possible for end-point and mid-point concepts, using the method of transformational assignment.

Usage

calibrate(x, type = "crisp", thresholds = NA, include = TRUE, logistic = FALSE,
          idm = 0.95, ecdf = FALSE, p = 1, q = 1)

Arguments

x
An interval or ratio-scaled base variable
type
The calibration type, either "crisp" or "fuzzy"
thresholds
A vector of thresholds
include
Logical, include threshold(s) in the set (type = "crisp" only)
logistic
Calibrate to fuzzy sets using the logistic function
idm
The set inclusion degree of membership for the logistic function
ecdf
Calibrate to fuzzy sets using the empirical cumulative distribution function (ECDF) of the base variable
p
Parameter: if p > 1 concentration, if 0 < p < 1 dilation below crossover
q
Parameter: if q > 1 dilation, if 0 < q < 1 concentration above crossover

Value

  • A numeric vector of crisp set values or fuzzy set membership scores

Details

Calibration is the process by which set membership scores are assigned to cases. With interval and ratio-scaled base variables, calibration can be based on transformational assignments using (piecewise-defined) membership functions. For type = "crisp", one threshold produces crisp sets with two groups - 0s and 1s. More thresholds produce multi-value data. For example, two thresholds produce three groups - 0s, 1s and 2s. For type = "fuzzy", this function can generate linear, s-shaped and inverted s-shaped fuzzy numbers with respect to end-point concepts, including logistic transformations. It can generate trapezoidal, triangular and bell-shaped fuzzy numbers with respect to mid-point concepts (Bojadziev and Bojadziev, 2007; Clark et al., 2008; Thiem and Dusa, 2012). For calibrating fuzzy sets based on end-point concepts, thresholds should be specified as a numeric vector thresholds = c(thEX, thCR, thIN), where thEX is the threshold for full set exclusion, thCR the threshold for set crossover, and thIN the threshold for full set inclusion. If thEX < thCR < thIN, then the membership function is increasing from thEX to thIN. If thIN < thCR < thEX, then the membership function is decreasing from thIN to thEX. For calibrating fuzzy sets based on mid-point concepts, thresholds should be specified as a vector thresholds = c(thEX1, thCR1, thIN1, thIN2, thCR2, thEX2), where thEX1 is the first (left) threshold for full set exclusion, thCR1 the first (left) threshold for set crossover, thIN1 the first (left) threshold for full set inclusion, thIN2 the second (right) threshold for full set inclusion, thCR2 the second (right) threshold for set crossover, and thEX2 the second (right) threshold for full set exclusion. If thEX1 < thCR1 < thIN1 <= thin2="" <="" thcr2="" thex2<="" code="">, then the membership function is first increasing from thEX1 to thIN1, then decreasing from thIN2 to thEX2. If thIN1 < thCR1 < thEX1 <= thex2="" <="" thcr2="" thin2<="" code="">, then the membership function is first decreasing from thIN1 to thEX1, then increasing from thEX2 to thIN2. The parameters p and q control the degree of concentration and dilation. They should be left at their default values unless good reasons to change them exist. If logistic = TRUE, the argument idm specifies the inclusion degree of membership in the set. The exclusion degree is automatically determined because of the symmetry of the logistic function. If ecdf = TRUE, calibration is based on the empirical cumulative distribution function of x. The arguments logistic and ecdf are mutually exclusive, with the first taking precedence over the second.

References

G. Bojadziev and M. Bojadziev. Fuzzy Logic for Business, Finance, and Management. 2nd ed., World Scientific, New Jersey, 2007. T. D. Clark, J. M. Larson, J. N. Mordeson, J. D. Potter, and M. J. Wierman. Applying Fuzzy Mathematics to Formal Models in Comparative Politics. Springer, Berlin, 2008. A. Thiem and A. Dusa. Qualitative Comparative Analysis with R: A User's Guide. Springer, New York, 2012.

Examples

Run this code
# 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