calibrate {QCApro} | R Documentation |
Calibrate Raw Data into Configurational Data
Description
This function generates configurational data from raw data (base variables) and some specified threshold(s). The calibration of bivalent fuzzy-set factors is possible for positive and negative 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) ( |
logistic |
Calibrate to fuzzy-set variable using the logistic function. |
idm |
The set inclusion degree of membership for the logistic function. |
ecdf |
Calibrate to fuzzy-set variable using the empirical cumulative distribution function of the base variable. |
p |
Parameter: if |
q |
Parameter: if |
Details
Calibration is the process by which configurational data is produced, that is, 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 a factor with two levels: 0 and
1. More thresholds produce factors with multiple levels. For example, two thresholds
produce three levels: 0, 1 and 2.
For type = "fuzzy"
, this function can generate bivalent fuzzy-set variables
by linear, s-shaped, inverted s-shaped and logistic transformation for end-point
concepts. It can generate bivalent fuzzy-set variables by trapezoidal, triangular
and bell-shaped transformation for mid-point concepts (Bojadziev and Bojadziev
2007; Clark et al. 2008; Thiem 2014; Thiem and Dusa 2013).
For calibrating bivalent fuzzy-set variables based on end-point concepts,
thresholds
should be specified as a numeric vector c(thEX, thCR, thIN)
,
where thEX
is the threshold for full exclusion, thCR
the threshold
for the crossover, and thIN
the threshold for full 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 bivalent fuzzy-set variables based on mid-point concepts,
thresholds
should be specified as a numeric vector
c(thEX1, thCR1, thIN1, thIN2, thCR2, thEX2)
, where thEX1
is the first
(left) threshold for full exclusion, thCR1
the first (left) threshold for
the crossover, thIN1
the first (left) threshold for full inclusion,
thIN2
the second (right) threshold for full inclusion, thCR2
the
second (right) threshold for crossover, and thEX2
the second (right) threshold
for full exclusion.
If thEX1
<
thCR1
<
thIN1
\le
thIN2
<
thCR2
<
thEX2
, then the membership function is first
increasing from thEX1
to thIN1
, then flat between thIN1
and
thIN2
, and finally decreasing from thIN2
to thEX2
. In contrast,
if thIN1
<
thCR1
<
thEX1
\le
thEX2
<
thCR2
<
thIN2
, then the membership function is first
decreasing from thIN1
to thEX1
, then flat between thEX1
and
thEX2
, and finally 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 for
changing them exist.
If logistic = TRUE
, the argument idm
specifies the inclusion degree
of membership.
If ecdf = TRUE
, calibration is based on the empirical cumulative distribution
function of x
.
Value
A numeric vector of set membership scores between 0 and 1 for bivalent crisp-set factors and bivalent fuzzy-set variables, or a numeric vector of levels for multivalent crisp-set factors (beginning with 0 at increments of 1).
Contributors
Dusa, Adrian | : programming |
Thiem, Alrik | : development, documentation, programming, testing |
Author(s)
Alrik Thiem (Personal Website; ResearchGate Website)
References
Bojadziev, George, and Maria Bojadziev. 2007. Fuzzy Logic for Business, Finance, and Management. 2nd ed. Hackensack, NJ: World Scientific. Link.
Clark, Terry D., Jennifer M. Larson, John N. Mordeson, Joshua D. Potter, and Mark J. Wierman. 2008. Applying Fuzzy Mathematics to Formal Models in Comparative Politics. Berlin: Springer. Link.
Thiem, Alrik. 2014. “Membership Function Sensitivity of Descriptive Statistics in Fuzzy-Set Relations.” International Journal of Social Research Methodology 17 (6):625-42. DOI: 10.1080/13645579.2013.806118.
Thiem, Alrik, and Adrian Dusa. 2013. Qualitative Comparative Analysis with R: A User's Guide. New York: Springer. Link.
Examples
# base variable; random draw from standard normal distribution
set.seed(30)
x <- rnorm(30)
# calibration thresholds
th <- quantile(x, seq(from = 0.05, to = 0.95, length = 6))
# calibration of bivalent crisp-set factor
calibrate(x, thresholds = th[3])
# calibration of trivalent crisp-set factor
calibrate(x, thresholds = c(th[2], th[4]))
# fuzzy-set calibration
# 1. positive end-point concept, linear
# 2. positive and corresponding negative end-point concept, logistic
# 3. positive end-point concept, ECDF
# 4. negative end-point concept, s-shaped (quadratic)
# 5. negative end-point concept, inverted s-shaped (root)
# 6. positive mid-point concept, triangular
# 7. positive mid-point concept, trapezoidal
# 8. negative mid-point concept, bell-shaped
yl <- "Set Membership"
xl <- "Base Variable Value"
par(mfrow = c(2,4), cex.main = 1)
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[1], (th[3]+th[4])/2,
th[6])), xlab = xl, ylab = yl,
main = "1. positive end-point concept,\nlinear")
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[1], (th[3]+th[4])/2,
th[6]), logistic = TRUE, idm = 0.99), xlab = xl, ylab = yl,
main = "2. positive and corresponding negative\nend-point concept, logistic")
points(x, calibrate(x, type = "fuzzy", thresholds = c(th[6], (th[3]+th[4])/2,
th[1]), logistic = TRUE, idm = 0.99))
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[1], (th[3]+th[4])/2,
th[6]), ecdf = TRUE), xlab = xl, ylab = yl,
main = "3. positive end-point concept,\nECDF")
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[6], (th[3]+th[4])/2,
th[1]), p = 2, q = 2), xlab = xl, ylab = yl,
main = "4. negative end-point concept,\ns-shaped (quadratic)")
plot(x, calibrate(x, type = "fuzzy", thresholds = c(th[6], (th[3]+th[4])/2,
th[1]), p = 0.5, q = 0.5), xlab = xl, ylab = yl,
main = "5. negative end-point concept,\ninverted s-shaped (root)")
plot(x, calibrate(x, type = "fuzzy", thresholds = th[c(1,2,3,3,4,5)]),
xlab = xl, ylab = yl, main = "6. positive mid-point concept,\ntriangular")
plot(x, calibrate(x, type = "fuzzy", thresholds = th[c(1,2,3,4,5,6)]),
xlab = xl, ylab = yl, main = "7. positive mid-point concept,\ntrapezoidal")
plot(x, calibrate(x, type = "fuzzy", thresholds = th[c(3,2,1,5,4,3)],
p = 3, q = 3), xlab = xl, ylab = yl,
main = "8. negative mid-point concept,\nbell-shaped")