Title: | Partial Orders in Socio-Economics |
---|---|
Description: | Implements tools for the analysis of partially ordered data, with a particular focus on the evaluation of multidimensional systems of indicators and on the analysis of poverty. References, Fattore M. (2016) <doi:10.1007/s11205-015-1059-6> Fattore M., Arcagni A. (2016) <doi:10.1007/s11205-016-1501-4> Arcagni A. (2017) <doi:10.1007/978-3-319-45421-4_19>. |
Authors: | Alberto Arcagni [aut, cre], Marco Fattore [aut] |
Maintainer: | Alberto Arcagni <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.2.7 |
Built: | 2025-01-23 03:39:14 UTC |
Source: | https://github.com/cran/parsec |
The package implements tools for the analysis of partially ordered data, with a particular focus on the evaluation of multidimensional systems of indicators and on the analysis of poverty.
Its main objective is to provide socio-economic scholars with an integrated set of elementary functions for multidimensional evaluation, based on ordinal information. In particular, it provides functions for data management and basic analysis of partial orders as well as other functions for the evaluation and application of both the poset-based approach and a more classic counting method.
A, Arcagni M, Fattore
Maintainer: A, Arcagni <[email protected]>
########################################### # a simple example of package application # ########################################### # definition of the variables by their number of grades variables <- c(2, 2, 2) # definition of the threshold threshold <- c("112", "211") # extraction of all of the possible profiles from variables; the # function returns an object of class "wprof", weighted profiles: by default, # weigths/frequencies are set equal to 1 profiles <- var2prof(varlen = variables) # the following function creates matrices describing the poset, and # provides all the results related to it eval <- evaluation(profiles, threshold, nit = 10^5, maxint = 10^3) # The results can then be summarized summary(summary(eval)) # a method of the plot function returns the Hasse diagram, a frequency # distribution of the threshold, the identification function, the rank # distribution of each profile through a barplot, and the relative gap. plot(eval) ######################################################### # a second example of new functions recently introduced # ######################################################### # definition of the variables and of the corresponding profiles v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) # definition of different distributions over the set of profiles k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) prof populations # evaluation of the fuzzy first order dominance res <- FFOD(profiles = prof, distributions = populations) res # rank stablity analysis res <- rank_stability(res) res # graphical representation plot(res)
########################################### # a simple example of package application # ########################################### # definition of the variables by their number of grades variables <- c(2, 2, 2) # definition of the threshold threshold <- c("112", "211") # extraction of all of the possible profiles from variables; the # function returns an object of class "wprof", weighted profiles: by default, # weigths/frequencies are set equal to 1 profiles <- var2prof(varlen = variables) # the following function creates matrices describing the poset, and # provides all the results related to it eval <- evaluation(profiles, threshold, nit = 10^5, maxint = 10^3) # The results can then be summarized summary(summary(eval)) # a method of the plot function returns the Hasse diagram, a frequency # distribution of the threshold, the identification function, the rank # distribution of each profile through a barplot, and the relative gap. plot(eval) ######################################################### # a second example of new functions recently introduced # ######################################################### # definition of the variables and of the corresponding profiles v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) # definition of different distributions over the set of profiles k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) prof populations # evaluation of the fuzzy first order dominance res <- FFOD(profiles = prof, distributions = populations) res # rank stablity analysis res <- rank_stability(res) res # graphical representation plot(res)
The function implements the OPHI counting approach, in a single call. The implementation is limited to ordinal attributes.
AF(y, ...) ## Default S3 method: AF(y, z, w=rep(1, ncol(y)), k=sum(w), freq=rep(1, nrow(y)), ...) ## S3 method for class 'wprof' AF(y, ...)
AF(y, ...) ## Default S3 method: AF(y, z, w=rep(1, ncol(y)), k=sum(w), freq=rep(1, nrow(y)), ...) ## S3 method for class 'wprof' AF(y, ...)
y |
matrix of profiles, possibly substituted by an object of class |
z |
vector of attribute cutoffs. |
w |
variables' weights. |
k |
overall cutoff. |
freq |
profiles' frequencies; the argument can be omitted if |
... |
any of the above. |
An object of S3 class ophi
containing all the outputs related to the OPHI counting approach. The object is a list
comprising:
y |
matrix of profiles, |
freq |
profiles' frequencies, |
d |
number of variables |
n |
number of observations (sum of frequencies), |
z |
vector of cutoffs, |
k |
overall cutoff, |
rho |
function comparing profiles to the vector of cutoffs, |
rho_k |
function comparing profiles to the overall cutoff, by weighting variables, |
g0 |
profile-variable matrix reporting the output of function
|
c |
censored vector of deprivation counts, |
Z_k |
boolean vector identifying deprived profiles, according to the specified cutoffs, |
q |
number of poor statstical units in the population, |
H |
headcount ratio, i.e. |
A |
average deprivation share, |
M0 |
adjusted headcount ratio. |
Alkire S., Foster J. (2011), Counting and multidimensional poverty measurement, Journal of Public Economics, 96(7-8), 476-487.
vl <- c(2, 3, 3, 2) prof <- var2prof(varlen = vl) res <- AF(prof, z = c(1, 2, 1, 1), k = 1) res
vl <- c(2, 3, 3, 2) prof <- var2prof(varlen = vl) res <- AF(prof, z = c(1, 2, 1, 1), k = 1) res
The function computes the threshold in the profile poset, which makes the poset approach equivalent to the AF counting approach, described in
argument mpi
.
AF2threshold(mpi, prof, zeta = NULL)
AF2threshold(mpi, prof, zeta = NULL)
mpi |
an object of class |
prof |
an object of class |
zeta |
an object of class |
vl <- c(2, 3, 2) prof <- var2prof(varlen = vl, labtype = "progressive") res <- AF(prof, z = c(1, 2, 1), k = 1) thr <- AF2threshold(res, prof) plot(prof, col = 1 + thr, lwd = 1 + res$c, main = "Comparison between OPHI and parsec", sub = "bold: deprived profiles identified by OPHI, red: parsec threshold") eval <- evaluation(prof, thr, maxint = 10^4, nit = 10^7) ord <- order(eval$idn_f, res$c) plot(eval$idn_f[ord], col = "red", lwd=2, type = "l", xlab="", ylab = "", axes = FALSE, frame.plot = TRUE, main = "Comparison between OPHI and parsec", sub = "red: identification function, black: OPHI deprived profiles") points(res$c[ord], type="l", lwd=2) axis(2)
vl <- c(2, 3, 2) prof <- var2prof(varlen = vl, labtype = "progressive") res <- AF(prof, z = c(1, 2, 1), k = 1) thr <- AF2threshold(res, prof) plot(prof, col = 1 + thr, lwd = 1 + res$c, main = "Comparison between OPHI and parsec", sub = "bold: deprived profiles identified by OPHI, red: parsec threshold") eval <- evaluation(prof, thr, maxint = 10^4, nit = 10^7) ord <- order(eval$idn_f, res$c) plot(eval$idn_f[ord], col = "red", lwd=2, type = "l", xlab="", ylab = "", axes = FALSE, frame.plot = TRUE, main = "Comparison between OPHI and parsec", sub = "red: identification function, black: OPHI deprived profiles") points(res$c[ord], type="l", lwd=2) axis(2)
The function checks whether boolean square matrix m
represents an antisymmetric binary relation.
antisymmetry(m)
antisymmetry(m)
m |
a square matrix. |
transitivity
, binary
, reflexivity
,
validate.partialorder.incidence
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] antisymmetry(M)
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] antisymmetry(M)
The function evaluates the average rank, and other distribution details, for each element of the poset.
average_ranks(x, ...) ## S3 method for class 'cover' average_ranks(x, level = 0.9, error = 10^(-5), ...) ## S3 method for class 'incidence' average_ranks(x, level = 0.9, error = 10^(-5), ...)
average_ranks(x, ...) ## S3 method for class 'cover' average_ranks(x, level = 0.9, error = 10^(-5), ...) ## S3 method for class 'incidence' average_ranks(x, level = 0.9, error = 10^(-5), ...)
x |
an incidence or cover matrix representing a partial order. |
level |
coverage probability of the rank intervals. |
error |
the "distance" from uniformity in the sampling distribution of linear extensions used to evaluate the average ranks. See |
... |
any of above. |
The function computes the rank distribution for each element of the poset, through function idn
. Next, it checks whether there are any equivalent profiles, using function equivalences
, and makes their rank distribution equal. Finally it provides a dataframe comprising, for each element of the poset: the average rank avrg
, the extremes inf
and sup
of the rank interval, the effective coverage probability of the rank interval prob
, the estimated minimum and maximum rank values (min
and max
) and the rank range
.
The output is a dataframe of class average_ranks
/for which a method of function plot
is available. See plot.average_ranks
for details).
A dataframe of class average_ranks
whose columns are:
avrg |
the average rank; |
inf |
the lower extreme of the rank interval; |
sup |
the upper extreme of the rank interval; |
prob |
the effective coverage probability of the rank interval; |
min |
the minimum rank; |
max |
the maximum rank; |
range |
the rank range. |
Fattore M., Arcagni A.
idn
, equivalences
, plot.average_ranks
profiles <- var2prof(varlen = c(3, 2, 2)) Z <- getzeta(profiles) res <- average_ranks(Z) plot(res)
profiles <- var2prof(varlen = c(3, 2, 2)) Z <- getzeta(profiles) res <- average_ranks(Z) plot(res)
The function checks whether square matrix m
represents a binary relation.
binary(m)
binary(m)
m |
a square matrix. |
is.partialorder
, validate.partialorder.incidence
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] binary(M)
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] binary(M)
The function returns colevels associated to poset elements.
colevels(y)
colevels(y)
y |
an object of class |
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) colevels(Z)
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) colevels(Z)
The function computes the incidence matrix of a poset from its cover matrix.
cover2incidence(g)
cover2incidence(g)
g |
a cover matrix, an object of class |
The function returns the corresponding incidence matrix, an object of class
incidence
.
The function computes the depths of poset elements.
depths(z)
depths(z)
z |
an object of class |
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) depths(Z)
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) depths(Z)
The function computes a boolean vector identifying the poset elements below (or equal to) at least one element of the input subset Q
.
downset(z, ...) ## S3 method for class 'cover' downset(z, ...) ## S3 method for class 'incidence' downset(z, Q = NULL, ...)
downset(z, ...) ## S3 method for class 'cover' downset(z, ...) ## S3 method for class 'incidence' downset(z, Q = NULL, ...)
z |
a cover, or an incidence, matrix of S3 class |
Q |
vector of indices identifying a subset of poset profiles |
... |
any of the above. |
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] downset(z, Q) Q <- c("211", "112", "111") downset(z, Q)
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] downset(z, Q) Q <- c("211", "112", "111") downset(z, Q)
Graphical function called by plot.cover
to draw the edges of the
Hasse diagram representing the input cover matrix C
.
drawedges(C, vertices, ...)
drawedges(C, vertices, ...)
C |
cover matrix. |
vertices |
coordinates of the vertices obtained by function |
... |
line parameters, see |
plot.cover
, vertices
, graphics{lines}
The function computes the set of poset elements sharing the same upset and downset.
equivalences(x)
equivalences(x)
x |
an object of class |
The function computes a vector assigning an equivalence class to each profile. The vector is of class factor
.
Arcagni A.
Lmbd <- getlambda(A > B, A > C, B > D, A > E, B > E, C > F, C > G) res <- equivalences(Lmbd) equivalence_classes <- levels(res) colrs <- sapply(res, function(x) which(equivalence_classes == x)) + 1 plot(Lmbd, col = colrs, lwd = 2)
Lmbd <- getlambda(A > B, A > C, B > D, A > E, B > E, C > F, C > G) res <- equivalences(Lmbd) equivalence_classes <- levels(res) colrs <- sapply(res, function(x) which(equivalence_classes == x)) + 1 plot(Lmbd, col = colrs, lwd = 2)
Given a partial order (arguments profiles
and/or
zeta
) and a selected threshold
,
the function returns an object of S3 class parsec
, comprising the identification function and
different severity measures, computed by uniform sampling of the linear extensions of the poset, through a C implementation of the Bubley - Dyer (1999) algorithm.
evaluation( profiles = NULL, threshold, error = 10^(-3), zeta = getzeta(profiles), weights = { if (!is.null(profiles)) profiles$freq else rep(1, nrow(zeta)) }, distances = { n <- nrow(zeta) matrix(1, n, n) - diag(1, n) }, linext = lingen(zeta), nit = floor({ n <- nrow(zeta) n^5 * log(n) + n^4 * log(error^(-1)) }), maxint = 2^31 - 1, inequality = FALSE ) inequality(profiles = NULL, zeta = getzeta(profiles), ...)
evaluation( profiles = NULL, threshold, error = 10^(-3), zeta = getzeta(profiles), weights = { if (!is.null(profiles)) profiles$freq else rep(1, nrow(zeta)) }, distances = { n <- nrow(zeta) matrix(1, n, n) - diag(1, n) }, linext = lingen(zeta), nit = floor({ n <- nrow(zeta) n^5 * log(n) + n^4 * log(error^(-1)) }), maxint = 2^31 - 1, inequality = FALSE ) inequality(profiles = NULL, zeta = getzeta(profiles), ...)
profiles |
an object of S3 class |
threshold |
a vector identifying the threshold. It can be a vector of indexes (numeric),
a vector of profile names (character) or a boolean vector of length equal to the number of
profiles. Function |
error |
the "distance" from uniformity in the sampling distribution of linear extensions. |
zeta |
the incidence matrix of the poset. An object of S3 class |
weights |
weights assigned to profiles. If the argument |
distances |
matrix of distances between pairs of profiles. The matrix must be square, with dimensions equal to the number of profiles. Even if the poset is complete, the distance between two profiles is computed only if one profile covers the other. |
linext |
the linear extension initializing the sampling algorithm. By default, it is generated by |
nit |
Number of ITerations in the Bubley-Dyer algorithm, by default evaluated from a formula of Karzanov and Khachiyan
based on the number of profiles and the argument |
maxint |
Maximum integer. By default the maximum integer obtainable in a 32bit system.
This argument is used to group iterations and run the compiled
C code more times, so as to avoid memory indexing problems. Users can
set a lower value to |
inequality |
boolean parameter (by default |
... |
further optional graphical parameters. See |
profiles |
an object of S3 class |
number_of_profiles |
number of profiles. |
number_of_variables |
number of variables. |
incidence |
S3 class |
cover |
S3 class |
threshold |
boolean vector specifying whether a profile belongs to the threshold. |
number_of_iterations |
number of iterations performed by the Bubley-Dyer algorithm. |
rank_dist |
matrix reporting by rows the relative frequency distributions of the ranks of each profile, over the set of sampled linear extensions. |
thr_dist |
vector reporting the relative frequency a profile is used as threshold in the sampled linear extensions. |
prof_w |
vector of weights assigned to each profile. |
edg_w |
matrix of distances between profiles, used to evaluate the gap measures. |
idn_f |
vector reporting the identification function, computed as the fraction of sampled linear extensions where a profile is in the downset of the threshold. |
svr_abs |
vector reporting, for each profile, the average graph distance from the first profile above all threshold elements, over the sampled linear extensions. In each linear extension, the distance is set equal to 0 for profiles above the threshold. |
svr_rel |
equal to svr_abs divided by its maximum, that is svr_abs of the minimal element in the linear extension. |
wea_abs |
vector reporting, for each profile, the average graph distance from the maximum threshold element, over the sampled linear extensions. In each linear extension, the distance is set equal to 0 for profiles in the downset of threshold elements. |
wea_rel |
the previous absolute distance is divided by its maximum possible value, that is the absolute distance of the threshold from the maximal element in the linear extension. |
poverty_gap |
Population mean of svr_rel |
wealth_gap |
Population mean of wea_rel |
inequality |
when the argument |
Bubley R., Dyer M. (1999), Faster random generation of linear extensions, Discrete Math., 201, 81-88.
Fattore M., Arcagni A. (2013), Measuring multidimensional polarization with ordinal data, SIS 2013 Statistical Conference, BES-M3.1 - The BES and the challenges of constructing composite indicators dealing with equity and sustainability
profiles <- var2prof(varlen = c(3, 2, 2)) threshold <- c("311", "112") res <- evaluation(profiles, threshold, maxint = 10^5) summary(res) plot(res)
profiles <- var2prof(varlen = c(3, 2, 2)) threshold <- c("311", "112") res <- evaluation(profiles, threshold, maxint = 10^5) summary(res) plot(res)
The function FOD
performs the Fuzzy First Order Dominance analysis described in Fattore and Arcagni (forthcoming).
FFOD(profiles, ...) ## S3 method for class 'wprof' FFOD(profiles, distributions = as.data.frame(profiles$freq), lambda = do.call( getlambda, as.list(names(profiles$profiles)) ), alpha = NULL, ... )
FFOD(profiles, ...) ## S3 method for class 'wprof' FFOD(profiles, distributions = as.data.frame(profiles$freq), lambda = do.call( getlambda, as.list(names(profiles$profiles)) ), alpha = NULL, ... )
profiles |
an object of class |
distributions |
a |
lambda |
object of class |
alpha |
vector of values to cut the |
... |
any of above. |
The function requires the set of profiles, through the object profiles
of class wprof
, and the corresponding frequencies, which can be defined by the argument distributions
of class data.frame
.
Notice that a warning is provided if the rownames
of the distributions do not match the rownamens
of the profiles.
Through poset lambda
, it is possible to provide (ordinal) information on the relative importance of the indicators in the multi-indicator system.
An object of class FODposet
containing:
delta |
matrix of the overall dominance degrees. |
mintr.delta |
matrix of the min-transitive closure of matrix |
global.approx |
L1 distance between |
global.approx.corr |
L1 distance between |
cell.approx |
matrix of absolute differences between the elements of |
posets.ind |
|
eqv.classes |
list of boolean matrices specifying, for each alpha-cut, the equivalence classes of the input distributions. Equivalence classes are reported by rows and the initial distributions by columns. If element ij of the matrix is |
covers |
list of objects of class |
Fattore M., Arcagni A.
Fattore M., Arcagni A. (forthcoming), F-FOD: Fuzzy First Order Dominance analysis and populations ranking over ordinal multi-indicator systems.
v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) prof populations res <- FFOD(profiles = prof, distributions = populations) res
v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) prof populations res <- FFOD(profiles = prof, distributions = populations) res
The function returns the antichain generating the input downset Q
, given the incidence matrix z
of the poset.
gen.downset(z, Q = 1)
gen.downset(z, Q = 1)
z |
an incidence matrix. |
Q |
a vector ( |
A boolean
vector.
lv <- c(2, 3, 2) prof <- var2prof(varlen = lv) z <- getzeta(prof) down <- c("111", "211", "112", "212") gen <- gen.downset(z, down) plot(z, lwd = 1 + (rownames(prof$profiles)%in%down), col = 1 + gen, sub = "bold = the downset, red = the antichain generating the downset")
lv <- c(2, 3, 2) prof <- var2prof(varlen = lv) z <- getzeta(prof) down <- c("111", "211", "112", "212") gen <- gen.downset(z, down) plot(z, lwd = 1 + (rownames(prof$profiles)%in%down), col = 1 + gen, sub = "bold = the downset, red = the antichain generating the downset")
The function returns the antichain generating the input upset Q
, given the incidence matrix z
of the poset.
gen.upset(z, Q = 1)
gen.upset(z, Q = 1)
z |
an incidence matrix. |
Q |
a vector ( |
A boolean
vector.
lv <- c(2, 3, 2) prof <- var2prof(varlen = lv) z <- getzeta(prof) up <- c("221", "131", "231", "222", "132", "232") gen <- gen.upset(z, up) plot(z, lwd = 1 + (rownames(prof$profiles)%in%up), col = 1 + gen, sub = "bold = the upset, red = the antichain generating the upset")
lv <- c(2, 3, 2) prof <- var2prof(varlen = lv) z <- getzeta(prof) up <- c("221", "131", "231", "222", "132", "232") gen <- gen.upset(z, up) plot(z, lwd = 1 + (rownames(prof$profiles)%in%up), col = 1 + gen, sub = "bold = the upset, red = the antichain generating the upset")
The function creates an object of class incidence
representing a partial order on the set of variables.
getlambda(...)
getlambda(...)
... |
Cover relations between variable pairs. |
Cover relations between pair of ariables are defined by the names of the two variables and the symbols <
and >
. For instance, if variable A is covered by variable B, write the cover relation as A < B
or B > A
. If a variable is not comparable to the others, write the name of the variable alone.
an object of class incidence
.
Alberto Arcagni
Lambda <- getlambda(BOTTOM < A, B > BOTTOM, INCOMP) plot(Lambda)
Lambda <- getlambda(BOTTOM < A, B > BOTTOM, INCOMP) plot(Lambda)
The function computes the incidence matrix from the set of input profiles y
.
The output is a boolean matrix of S3 class incidence
.
getzeta(y) ## S3 method for class 'wprof' getzeta(y)
getzeta(y) ## S3 method for class 'wprof' getzeta(y)
y |
the set of profiles, an object of S3 class |
prf <- var2prof(varlen = c(2, 3)) getzeta(prf)
prf <- var2prof(varlen = c(2, 3)) getzeta(prf)
The function computes the vector of heights of poset elements.
heights(z)
heights(z)
z |
an object of class |
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) heights(Z)
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) heights(Z)
Given a partial order (arguments profiles
and/or
zeta
) and a selected threshold
,
the function computes the identification function, as a S3 class object parsec
. The identification function is computed by uniform sampling of the linear extensions of the input poset, through a C implementation of the Bubley - Dyer (1999) algorithm. idn is a simplified and faster version of evaluation, computing just the identification function.
idn( profiles = NULL, threshold, error = 10^(-3), zeta = getzeta(profiles), weights = { if (!is.null(profiles)) profiles$freq else rep(1, nrow(zeta)) }, linext = lingen(zeta), nit = floor({ n <- nrow(zeta) n^5 * log(n) + n^4 * log(error^(-1)) }), maxint = 2^31 - 1 )
idn( profiles = NULL, threshold, error = 10^(-3), zeta = getzeta(profiles), weights = { if (!is.null(profiles)) profiles$freq else rep(1, nrow(zeta)) }, linext = lingen(zeta), nit = floor({ n <- nrow(zeta) n^5 * log(n) + n^4 * log(error^(-1)) }), maxint = 2^31 - 1 )
profiles |
an object of S3 class |
threshold |
a vector identifying the threshold. It can be a vector of indexes (numeric), a vector of poset element names (character) or a boolean vector of length equal to the number of elements. |
error |
the "distance" from uniformity in the sampling distribution of linear extensions. |
zeta |
the incidence matrix of the poset. An object of S3 class |
weights |
weights assigned to profiles. If the argument |
linext |
the linear extension initializing the sampling algorithm. By default, it is generated by |
nit |
Number of iterations in the Bubley-Dyer algorithm, by default evaluated using a formula of Karzanov and Khachiyan
based on the number of poset elements and the argument |
maxint |
Maximum integer. By default the maximum integer obtainable in a 32bit system.
This argument is used to group iterations and run the compiled
C code more times, so as to avoid memory indexing problems. User can
set a lower value to |
profiles |
an object of S3 class |
number_of_profiles |
number of profiles. |
number_of_variables |
number of variables. |
incidence |
S3 class |
cover |
S3 class |
threshold |
boolean vector specifying whether a profile belongs to the threshold. |
number_of_iterations |
number of iterations performed by the Bubley Dyer algorithm. |
rank_dist |
matrix reporting by rows the relative frequency distribution of the poverty ranks of each profile, over the set of sampled linear extensions. |
thr_dist |
vector reporting the relative frequency a profile is used as threshold in the sampled linear extensions. This result is useful for a posteriori valuation of the poset threshold. |
prof_w |
vector of weights assigned to each profile. |
edges_weights |
matrix of distances between profiles, used to evaluate the measures of gap. |
idn_f |
vector reporting the identification function, computed as the fraction of sampled linear extensions where a profile is in the downset of the threshold. |
svr_abs |
|
svr_rel |
|
wea_abs |
|
wea_rel |
|
poverty_gap |
|
wealth_gap |
|
inequality |
|
Bubley R., Dyer M. (1999), Faster random generation of linear extensions, Discrete Math., 201, 81-88.
Fattore M., Arcagni A. (2013), Measuring multidimensional polarization with ordinal data, SIS 2013 Statistical Conference, BES-M3.1 - The BES and the challenges of constructing composite indicators dealing with equity and sustainability
profiles <- var2prof(varlen = c(3, 2, 4)) threshold <- c("311", "112") res <- idn(profiles, threshold, maxint = 10^5) summary(res) plot(res)
profiles <- var2prof(varlen = c(3, 2, 4)) threshold <- c("311", "112") res <- idn(profiles, threshold, maxint = 10^5) summary(res) plot(res)
The function computes the cover matrix associated to the input incidence matrix (i.e. the cover matrix whose transitive closure is the input incidence matrix).
incidence2cover(z)
incidence2cover(z)
z |
an incidence matrix, an object of class |
Cover matrix, an object of class
cover
.
The function computes the set of pairwise incomparabilities between poset elements.
incomp(z)
incomp(z)
z |
an incidence matrix. |
A boolean matrix whose element ij is TRUE
when profiles i and j
are incomparable.
vl <- c(2, 2, 2) pr <- var2prof(varlen = vl) Z <- getzeta(pr) incomp(Z)
vl <- c(2, 2, 2) pr <- var2prof(varlen = vl) Z <- getzeta(pr) incomp(Z)
The function checks whether the input set of poset elements Q
is a downset of the poset represented by the incidence matrix z
.
is.downset(z, Q = 1)
is.downset(z, Q = 1)
z |
incidence matrix |
Q |
vector identifying the input set of profiles. |
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] is.downset(z, Q) Q <- c("211", "112", "111") is.downset(z, Q)
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] is.downset(z, Q) Q <- c("211", "112", "111") is.downset(z, Q)
The function checks whether the input argument order
is a linear extension of the poset represented by the incidence matrix z
.
is.linext(order, z)
is.linext(order, z)
order |
indexes of the poset elements (as rows and columns of |
z |
incidence matrix. |
Z <- getzeta(var2prof(varlen = c(3, 3))) ranks <- c(1, 4, 2, 3, 5, 7, 6, 8, 9) names(ranks) <- rownames(Z) ranks is.linext(order = ranks, z = Z)
Z <- getzeta(var2prof(varlen = c(3, 3))) ranks <- c(1, 4, 2, 3, 5, 7, 6, 8, 9) names(ranks) <- rownames(Z) ranks is.linext(order = ranks, z = Z)
The function checks whether the input boolean square matrix m
represents a partial order.
is.partialorder(m)
is.partialorder(m)
m |
a boolean square matrix.. |
transitivity
, binary
, reflexivity
,
validate.partialorder.incidence
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] is.partialorder(M)
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] is.partialorder(M)
The function checks whether the input boolean square matrix m
represents a preorder.
is.preorder(m)
is.preorder(m)
m |
a boolean square matrix. |
transitivity
, binary
, reflexivity
,
antisymmetry
, is.partialorder
,
validate.partialorder.incidence
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] is.preorder(M)
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] is.preorder(M)
The function checks whether the input set of elements Q
is an upset of the poset represented by the incidence matrix z
.
is.upset(z, Q = 1)
is.upset(z, Q = 1)
z |
an incidence matrix. |
Q |
vector specifying the input set of poset elements. |
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] is.upset(z, Q) Q <- c("211", "112", "111") is.upset(z, Q)
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] is.upset(z, Q) Q <- c("211", "112", "111") is.upset(z, Q)
The function returns the LaTeX code to create a tikz figure representing the Hasse diagram drawn from a set of profiles (prof
), an incidence matrix (Z
) or a cover matrix (C
). The code can be copied and pasted into a latex
file. The latex
source requires the tikz
package,
latex(y, ...) ## S3 method for class 'wprof' latex(y, label = "", caption = "", scale = c(1, 1), ...) ## S3 method for class 'incidence' latex(y, label = "", caption = "", scale = c(1, 1), ...) ## S3 method for class 'cover' latex(y, label = "", caption = "", scale = c(1, 1), ...)
latex(y, ...) ## S3 method for class 'wprof' latex(y, label = "", caption = "", scale = c(1, 1), ...) ## S3 method for class 'incidence' latex(y, label = "", caption = "", scale = c(1, 1), ...) ## S3 method for class 'cover' latex(y, label = "", caption = "", scale = c(1, 1), ...)
y |
an object of S3 class |
label |
the label of the LaTeX figure. |
caption |
the caption of the LaTeX figure. |
scale |
a vector of two elements to control the scale of the X-axis and the scale of the Y-axis in the LaTeX output. |
... |
any of above. |
prof <- var2prof(varlen = c(2, 3)) latex(prof, label="fg:hasse", caption="Hasse diagram", scale = c(2, 2))
prof <- var2prof(varlen = c(2, 3)) latex(prof, label="fg:hasse", caption="Hasse diagram", scale = c(2, 2))
The function generates all of the linear extensions of the partial order defined by the incidence matrix Lambda
.
LE(Lambda)
LE(Lambda)
Lambda |
incidence matrix. |
a list of vectors representing all linear orders compatible with the Lambda
incidence matrix.
Alberto Arcagni
Lambda <- getlambda(A < B, A < C, D < C) LE(Lambda)
Lambda <- getlambda(A < B, A < C, D < C) LE(Lambda)
The function generates the incidence matrices of the lexicographic linear extensions of a profile poset, given the variables (argument varmod
or varlen
) and a list of complete orders on them (argument lst
).
LE2incidence( lst, varmod = lapply(as.list(varlen), function(lst) 1:lst), varlen = sapply(varmod, length) ) ## Default S3 method: LE2incidence( lst, varmod = lapply(as.list(varlen), function(lst) 1:lst), varlen = sapply(varmod, length) ) ## S3 method for class 'list' LE2incidence( lst, varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length) )
LE2incidence( lst, varmod = lapply(as.list(varlen), function(lst) 1:lst), varlen = sapply(varmod, length) ) ## Default S3 method: LE2incidence( lst, varmod = lapply(as.list(varlen), function(lst) 1:lst), varlen = sapply(varmod, length) ) ## S3 method for class 'list' LE2incidence( lst, varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length) )
lst |
a vector of |
varmod |
list of variables and their grades. See details. |
varlen |
a vector with the number of grades of each variable. See details. |
Argument lst
is a list of chracter vectors. Each vector lists variable names in increasing order.
List varmod
and vector varlen
must be named so as to identify the variables they refer to. Profiles are generated as combinations of the variables' grades. The names of the profiles are the grades of the variables concatenated, after the variables order in varmod
/varlen
. See var2prof
for more details about these arguments.
an object of S3 class incidence
or a list of objects of S3 class incidence
.
Alberto Arcagni
Lambda <- getlambda(A < B, C < D) plot(Lambda) lst <- LE(Lambda) vl <- c(A = 2, B = 2, C = 2, D = 2) lstZeta <- LE2incidence(lst, varlen = vl) for (x in lstZeta) plot(x)
Lambda <- getlambda(A < B, C < D) plot(Lambda) lst <- LE(Lambda) vl <- c(A = 2, B = 2, C = 2, D = 2) lstZeta <- LE2incidence(lst, varlen = vl) for (x in lstZeta) plot(x)
The methods return a vector associating each profile with the corresponding
level.
The behaviour of these methods for objects of classes incidence
and
cover
is different from the behaviour of function
levels
for factors.
## S3 method for class 'incidence' levels(x) ## S3 method for class 'cover' levels(x)
## S3 method for class 'incidence' levels(x) ## S3 method for class 'cover' levels(x)
x |
an object of class |
the function levels
for objects of type factor
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) levels(Z)
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) levels(Z)
The function computes a vector of ranks, defining a linear extension of the poset represented by incidence matrix z
.
lingen(z)
lingen(z)
z |
an incidence matrix. |
Z <- getzeta(var2prof(varlen = c(3, 3))) lingen(Z)
Z <- getzeta(var2prof(varlen = c(3, 3))) lingen(Z)
The function computes the incidence matrix of the linear order defined by the rank vector lin
. It returns an object of S3 class incidence
.
linzeta(lin)
linzeta(lin)
lin |
a vector of elements' ranks. |
ranks <- c(5, 3, 4, 2, 1) names(ranks) <- LETTERS[1:5] linzeta(ranks) plot(linzeta(ranks))
ranks <- c(5, 3, 4, 2, 1) names(ranks) <- LETTERS[1:5] linzeta(ranks) plot(linzeta(ranks))
The function returns a boolean vector identifying the maximal elements of the poset.
maximal(z)
maximal(z)
z |
an object of class |
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) maximal(Z)
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) maximal(Z)
Method of the function merge
of package base
to merge two objects of class wprof
generated through functions var2prof
or pop2prof
.
## S3 method for class 'wprof' merge(x, y, support = FALSE, FUN = "+", all = TRUE, ...)
## S3 method for class 'wprof' merge(x, y, support = FALSE, FUN = "+", all = TRUE, ...)
x , y
|
objects of class |
support |
boolean variables specifying whether |
FUN |
function to be applied to the profiles' frequencies (by default, FUN = |
all |
same argument of function |
... |
additional arguments to be passed to method |
Objects of class wprof
are composed of a data.frame
of profiles and a vector of frequencies. This method applies method merge.data.frame
to the profiles and applies function FUN
to the frequencies.
If support
is TRUE
, function merge.data.frame
is not used and the output corresponds to the object y
, but with its frequencies modified. These are set equal to the frequencies of the corresponding profiles in x
, or to 0 for profiles not contained in x
.
Arcagni A.
n <- 5 v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 set.seed(0) pop <- data.frame( v1 = sample(v1, n, replace = TRUE), v2 = sample(v2, n, replace = TRUE) ) survey_weights <- round(runif(5)*10) prof1 <- pop2prof(pop, weights = survey_weights) prof2 <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) # prof2 is the support of prof1 merge(prof1, prof2, support = TRUE) # union between the two sets of profiles and their frequencies are added merge(prof1, prof2) # intersection of the sets of profiles with the assumption # that the minimum number of observations is shared # between the two distributions merge(prof1, prof2, all = FALSE, FUN = min) prof2$freq <- prof2$freq*10 # to remove from prof2 the observations in prof1 distribution <- merge(prof2, prof1, FUN = "-"); distribution
n <- 5 v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 set.seed(0) pop <- data.frame( v1 = sample(v1, n, replace = TRUE), v2 = sample(v2, n, replace = TRUE) ) survey_weights <- round(runif(5)*10) prof1 <- pop2prof(pop, weights = survey_weights) prof2 <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) # prof2 is the support of prof1 merge(prof1, prof2, support = TRUE) # union between the two sets of profiles and their frequencies are added merge(prof1, prof2) # intersection of the sets of profiles with the assumption # that the minimum number of observations is shared # between the two distributions merge(prof1, prof2, all = FALSE, FUN = min) prof2$freq <- prof2$freq*10 # to remove from prof2 the observations in prof1 distribution <- merge(prof2, prof1, FUN = "-"); distribution
The function returns a boolean vector identifying the minimal elements of the poset.
minimal(z)
minimal(z)
z |
an object of class |
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) minimal(Z)
vl <- c(3, 2, 4) prof <- var2prof(varlen = vl) Z <- getzeta(prof) minimal(Z)
The function merges posets defined through a list of incidence matrices or a list of complete orders between the variables (argument lst
). In the second case the variables must be defined (argument varmod
or varlen
).
mrg( lst, varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length) ) ## S3 method for class 'incidence' mrg(lst, varmod = NULL, varlen = NULL) ## S3 method for class 'character' mrg( lst, varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length) )
mrg( lst, varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length) ) ## S3 method for class 'incidence' mrg(lst, varmod = NULL, varlen = NULL) ## S3 method for class 'character' mrg( lst, varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length) )
lst |
a list of incidence matrices (class |
varmod |
list of variables and their grades. See details. |
varlen |
a vector of number of grades of each variable. See details. |
For efficiency reasons, the argument lst
can be also a list of vectors of characters. In this case, each vector lists the names of the variables in increasing order.
The list varmod
and the vector varlen
must be named, so as to identify the variables they refer to. The profiles are generated by the combinations of the variables grades. The names of the profiles are the grades of the variables concatenated, according to variables order in varmod
/varlen
. See var2prof
for more details about these arguments.
an object of S3 class incidence
.
Alberto Arcagni
# Example with lst as list of incidence matrices Lambda <- getlambda(A < B, C < D) plot(Lambda) lst <- LE(Lambda) vl <- c(A = 2, B = 2, C = 2, D = 2) lstZeta <- LE2incidence(lst, varlen = vl) for (x in lstZeta) plot(x) mrg(lstZeta) # Example with lst as list of characters Lambda <- getlambda(A < B, C < D) lst <- LE(Lambda) vl <- c(A = 2, B = 2, C = 2, D = 2) Zeta <- mrg(lst, varlen = vl) plot(Zeta)
# Example with lst as list of incidence matrices Lambda <- getlambda(A < B, C < D) plot(Lambda) lst <- LE(Lambda) vl <- c(A = 2, B = 2, C = 2, D = 2) lstZeta <- LE2incidence(lst, varlen = vl) for (x in lstZeta) plot(x) mrg(lstZeta) # Example with lst as list of characters Lambda <- getlambda(A < B, C < D) lst <- LE(Lambda) vl <- c(A = 2, B = 2, C = 2, D = 2) Zeta <- mrg(lst, varlen = vl) plot(Zeta)
Function to evaluate Mutial Ranking Probability (MRP) matrix based on netrankr
package.
MRP(Z, method = c("exact", "mcmc", "approx"), error = 10^(-3), nit = NULL) ## S3 method for class 'incidence' MRP(Z, method = c("exact", "mcmc", "approx"), error = 10^(-3), nit = NULL)
MRP(Z, method = c("exact", "mcmc", "approx"), error = 10^(-3), nit = NULL) ## S3 method for class 'incidence' MRP(Z, method = c("exact", "mcmc", "approx"), error = 10^(-3), nit = NULL)
Z |
an incidence matrix, an object of class |
method |
a string to choose the method applied to evaluate the MRP matrix. The default value is |
error |
considered only if |
nit |
considered only if |
Package netrankr
provides three functions to evaluate MRP matrix. Note that MRP matrix definition in netrankr
is a little different from the one used in Fattore and Arcagni (2018), therefore this function unifies the results to the second definition.
Parameter method
allows the selection of which function of package netrankr
to use: "exact"
runs the function exact_rank_prob
that provides the exact results, "mcmc"
the function mcmc_rank_prob
that provide the estimated results through the Bubley Dyer algorithm and "approx"
runs the function approx_rank_relative
that provide the Bruggemann and Carlsen (2011) approximated results. For small posets it is possible to evaluate the exact MRP matrix, for larger posets it is necessary to use the appoximated results.
An object of class matrix
representing the MRP matrix. Dimensions names are equal to incidence matrix ones.
Bruggemann R., Carlsen L., (2011). An improved estimation of averaged ranks of partial orders. MATCH Commun. Math. Comput. Chem., 65(2):383-414.
Bubley R., Dyer M. (1999), Faster random generation of linear extensions, Discrete Math., 201, 81-88.
Fattore M., Arcagni A. (2018). Using mutual ranking probabilities for dimensionality reduction and ranking extraction in multidimensional systems of ordinal variables. Advances in Statistical Modelling of Ordinal Data, 117.
exact_rank_prob
, mcmc_rank_prob
, approx_rank_relative
L <- getlambda(A < B, C < B, B < D) MRP(L)
L <- getlambda(A < B, C < B, B < D) MRP(L)
The function returns the mutual ranking probabilities matrix evaluated considering only the lexicographic linear extensions. Results are obtained by exact formula.
MRPlex(profiles, selection = NULL)
MRPlex(profiles, selection = NULL)
profiles |
an object of S3 class |
selection |
a vector of |
The MRP matrix of the selected profiles.
prf <- var2prof(varlen = c(2, 2, 2)) MRPlex(prf)
prf <- var2prof(varlen = c(2, 2, 2)) MRPlex(prf)
The function removes, from the set of possible profiles prof
derived from the multi-indicator system, those unobserved in the input dataset (i.e. profiles with associated frequency equal to zero). It returns an object of class S3 wprof
comprising the observed profiles and their frequencies.
obsprof(prof) ## S3 method for class 'wprof' obsprof(prof)
obsprof(prof) ## S3 method for class 'wprof' obsprof(prof)
prof |
object of S3 class |
prf <- var2prof(varlen = c(3, 3, 3)) prf$freq <- sample(c(0, 1), 3*3*3, replace = TRUE) prf <- obsprof(prf) plot(prf, shape = "equispaced")
prf <- var2prof(varlen = c(3, 3, 3)) prf$freq <- sample(c(0, 1), 3*3*3, replace = TRUE) prf <- obsprof(prf) plot(prf, shape = "equispaced")
igraph
.
The function turns a cover matrix to an igraph
object, so as to allow using the graphical power of igraph
to plot Hasse diagrams. Objects of class cover
are boolean matrices where element ij is equal to 1 if element i is covered by element j. This makes the cover matrix the transpose of the adjacency matrix of a graph, describing the cover relation in igraph
.
parsec2igraph(p, ...) ## S3 method for class 'cover' parsec2igraph(p, ...) ## S3 method for class 'incidence' parsec2igraph(p, ...)
parsec2igraph(p, ...) ## S3 method for class 'cover' parsec2igraph(p, ...) ## S3 method for class 'incidence' parsec2igraph(p, ...)
p |
an object of class |
... |
additional arguments of the function |
The function returns an object of class igraph
, representing the directed graph defined by the cover relation.
The function adds to the graph a layout generated through function vertices
, so as to plot the graph according to the conventions used for Hasse diagrams.
Arcagni, A.
Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.org
example(merge.wprof) poset <- getzeta(distribution) incidence2cover(poset) G <- parsec2igraph(poset, noise = TRUE) get.adjacency(G) # tkplot(G, vertex.size = distribution$freq, vertex.color = "white") G <- parsec2igraph(poset, noise = 10) # tkplot(G, vertex.size = distribution$freq, vertex.color = "white")
example(merge.wprof) poset <- getzeta(distribution) incidence2cover(poset) G <- parsec2igraph(poset, noise = TRUE) get.adjacency(G) # tkplot(G, vertex.size = distribution$freq, vertex.color = "white") G <- parsec2igraph(poset, noise = 10) # tkplot(G, vertex.size = distribution$freq, vertex.color = "white")
plot
for objects of class average_ranks
From the output of the function average_ranks
, the function plots the average rank and the associated rank interval, for each element of the poset.
## S3 method for class 'average_ranks' plot(x, range.first = TRUE, range.col = "black", range.lty = 1, range.lwd = 1, type = "p", ylim = c(nrow(x), 1), xlab = "", ylab = "Average rank", pch = c(16, 3, 3), col = "black", cex = c(1, 1, 1), ... )
## S3 method for class 'average_ranks' plot(x, range.first = TRUE, range.col = "black", range.lty = 1, range.lwd = 1, type = "p", ylim = c(nrow(x), 1), xlab = "", ylab = "Average rank", pch = c(16, 3, 3), col = "black", cex = c(1, 1, 1), ... )
x |
An object of class |
range.first |
A boolean attribute to specify whether the interval is plotted in background ( |
range.col |
Color of the interval. |
range.lty |
The line type to represent the range; the values are the same of the attribute |
range.lwd |
Width of the lines representing the range. |
type |
Attribute of the function |
ylim |
Attribute of function |
xlab |
Attribute of the function |
ylab |
Attribute of the function |
pch |
Attribute of the function |
col |
Attribute of the function |
cex |
Attribute of the function |
... |
Other arguments of the function |
average_ranks
, plot.default
, matplot
profiles <- var2prof(varlen = c(3, 2, 4)) Z <- getzeta(profiles) res <- average_ranks(Z) plot(res)
profiles <- var2prof(varlen = c(3, 2, 4)) Z <- getzeta(profiles) res <- average_ranks(Z) plot(res)
plot
methods to draw Hasse diagrams, for objects of S3 classes wprof
, incidence
, cover
,
## S3 method for class 'wprof' plot(x, shape = c("square", "circle", "equispaced"), noise = FALSE, ...) ## S3 method for class 'incidence' plot(x, shape = c("square", "circle", "equispaced"), noise = FALSE, ...) ## S3 method for class 'cover' plot(x, shape = c("square", "circle", "equispaced"), noise = FALSE, pch = 21, cex = max(nchar(rownames(x))) + 2, bg = "white", ...)
## S3 method for class 'wprof' plot(x, shape = c("square", "circle", "equispaced"), noise = FALSE, ...) ## S3 method for class 'incidence' plot(x, shape = c("square", "circle", "equispaced"), noise = FALSE, ...) ## S3 method for class 'cover' plot(x, shape = c("square", "circle", "equispaced"), noise = FALSE, pch = 21, cex = max(nchar(rownames(x))) + 2, bg = "white", ...)
x |
an object of S3 class |
shape |
shape of the Hasse diagram. See |
,
noise |
jittering in the shape of the Hasse diagram. See |
pch |
graphical parameter. See |
cex |
graphical parameter. See |
bg |
graphical parameter. See |
... |
further optional graphical parameters. See |
prf <- var2prof(varlen = c(5, 5, 5)) prf$freq <- sample(c(rep(0, 20), 1, 2, 3), 5*5*5, replace = TRUE) prf <- obsprof(prf) z <- getzeta(prf) plot(z, shape = "equispaced", col = prf$freq, lwd = 2)
prf <- var2prof(varlen = c(5, 5, 5)) prf$freq <- sample(c(rep(0, 20), 1, 2, 3), 5*5*5, replace = TRUE) prf <- obsprof(prf) z <- getzeta(prf) plot(z, shape = "equispaced", col = prf$freq, lwd = 2)
evaluation
.
Several representations of the results provided by the evaluation function.
## S3 method for class 'parsec' plot( x, which = c("Hasse", "threshold", "identification", "rank", "gap"), ask = dev.interactive(), shape = c("square", "circle", "equispaced"), noise = FALSE, ... )
## S3 method for class 'parsec' plot( x, which = c("Hasse", "threshold", "identification", "rank", "gap"), ask = dev.interactive(), shape = c("square", "circle", "equispaced"), noise = FALSE, ... )
x |
an object of S3 class |
which |
the names of the graphs to be plotted (
|
ask |
boolean value indicating whether the system has to ask users before changing the plot. |
shape |
the shape of the Hasse diagram, see |
noise |
jittering in the shape of the Hasse diagram. See |
... |
further arguments for the |
profiles <- var2prof(varlen = c(3, 2, 4)) threshold <- c("311", "112") res <- evaluation(profiles, threshold, nit = 10^3) plot(res)
profiles <- var2prof(varlen = c(3, 2, 4)) threshold <- c("311", "112") res <- evaluation(profiles, threshold, nit = 10^3) plot(res)
rank_stability.
The function generates four plots, to reproduce the sequence of the average ranks and of the positions of the elements, in the rankings associated to the alpha-cut posets.
Rankings and average ranks have to be evaluted with the function rank_stability
.
First and third plots show the sequence of average ranks, second and fourth show the sequence of rankings. Sequences in first and second plots are shown against the sequence of alpha-cuts, in third and fourth plots as a function of alpha values.
## S3 method for class 'rank_stability' plot(x, which = 1:4, legend = TRUE, legend.x = "bottomleft", legend.y = NULL, legend.bg = "white", grid = TRUE, grid.lty = 2, grid.col = rgb(0, 0, 0, 1/7), grid.lwd = 1, y_axis = "reversed", ask = dev.interactive(), type = "l", col = gray(1:ncol(x$ranking)/ncol(x$ranking)/1.3), lwd = 3, lty = 1, ... )
## S3 method for class 'rank_stability' plot(x, which = 1:4, legend = TRUE, legend.x = "bottomleft", legend.y = NULL, legend.bg = "white", grid = TRUE, grid.lty = 2, grid.col = rgb(0, 0, 0, 1/7), grid.lwd = 1, y_axis = "reversed", ask = dev.interactive(), type = "l", col = gray(1:ncol(x$ranking)/ncol(x$ranking)/1.3), lwd = 3, lty = 1, ... )
x |
object of class |
which |
select a subset of the numbers 1:4, to specify the desired plots. See caption below (and the 'Details'). |
legend |
boolean argument to choose whether to show the legend in the plots. |
legend.x , legend.y , legend.bg
|
arguments |
grid |
boolean argument to choose whether to show the grid in the plots. |
grid.lty , grid.col , grid.lwd
|
arguments defining the line type, color and width of the grid. |
y_axis |
if it is set equal to "reversed" plots show the y axis reversed. |
ask |
boolean argument indicating whether the system has to ask users before changing plots. |
type |
1-character string giving the desired type of plot. See |
col |
vector of colors. See |
lwd |
vector of line widths. See |
lty |
vector of line types. See |
... |
other arguments of function |
rank_stability
, legend
, plot.default
, matplot
v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) x <- FFOD(profiles = prof, distributions = populations) res <- rank_stability(x) plot(res)
v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) x <- FFOD(profiles = prof, distributions = populations) res <- rank_stability(x) plot(res)
Extract the observed profiles and the corresponding frequencies, out of the statistical population.
pop2prof( y, labtype = c("profiles", "progressive", "rownames"), sep = "", weights = rep(1, nrow(y)) )
pop2prof( y, labtype = c("profiles", "progressive", "rownames"), sep = "", weights = rep(1, nrow(y)) )
y |
a dataset, used to count profile frequencies. See details. |
labtype |
users can choose the type of labels to assign to profiles. See details. |
sep |
variables separator in the profiles labels. |
weights |
a vector of length equal to the number of observations in |
y
is a data.frame of observations on the ordinal or numeric variables. The partial order must be defined within the object type, so as to build the incidence matrix of the order relation (see getzeta
).
The function extracts variables and their observed modalities from the population; it builds all possible profiles and assigns to them the corresponding frequency. If some modalities are not observed in the population, they will not be used to build the profiles. If one is interested in the set of all possible profiles from a given set of variables, function var2prof
is to be used.
Users can choose the label type to assign to profiles. Accepetd types are: profiles
the variabiles modalities, progressive
a progressive numeration, rownames
the rownames in the dataset.
The function returns a S3 class object wprof
, "weighted profiles", containing the data.frame
named profiles
and the frequency vector freq
.
n <- 5 v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 pop <- data.frame( v1 = sample(v1, n, replace = TRUE), v2 = sample(v2, n, replace = TRUE) ) pop2prof(pop)
n <- 5 v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 pop <- data.frame( v1 = sample(v1, n, replace = TRUE), v2 = sample(v2, n, replace = TRUE) ) pop2prof(pop)
The function identifies in a matrix y
, profiles in prof
.
For each row of matrix y
, the function returns the location of the
corresponding profile in object prof
.
popelem(prof, ...) ## S3 method for class 'wprof' popelem(prof, y, ...)
popelem(prof, ...) ## S3 method for class 'wprof' popelem(prof, y, ...)
prof |
an object of S3 class |
y |
a |
... |
any of the above. |
vl <- c(2, 3, 2) prf <- var2prof(varlen = vl) pop <- matrix(c(2, 1, 1, 1, 2, 1, 2, 3, 1), 3, 3) rownames(pop) <- LETTERS[1:3] v <- popelem(prof = prf, y = pop) v prf$profiles[v,]
vl <- c(2, 3, 2) prf <- var2prof(varlen = vl) pop <- matrix(c(2, 1, 1, 1, 2, 1, 2, 3, 1), 3, 3) rownames(pop) <- LETTERS[1:3] v <- popelem(prof = prf, y = pop) v prf$profiles[v,]
The function computes profile frequencies, by counting the number of times a profile appears in the population.
proFreq(profiles, population)
proFreq(profiles, population)
profiles |
an object of S3 class |
population |
a |
An object of class wprof
with the same profiles of the argument but with different frequencies.
Alberto Arcagni
vl <- c(2, 3, 2) prf <- var2prof(varlen = vl) pop <- matrix(c(2, 1, 1, 1, 2, 1, 2, 3, 1), 3, 3) rownames(pop) <- LETTERS[1:3] proFreq(profiles = prf, population = pop)
vl <- c(2, 3, 2) prf <- var2prof(varlen = vl) pop <- matrix(c(2, 1, 1, 1, 2, 1, 2, 3, 1), 3, 3) rownames(pop) <- LETTERS[1:3] proFreq(profiles = prf, population = pop)
The function computes the average ranks and the positions in the ranking of the elements of the alpha-cuts.
rank_stability(x, ...) ## S3 method for class 'FODposet' rank_stability(x, selection = 1:length(x$covers), coverage_probability = 0.9, error = 10^(-5), ... )
rank_stability(x, ...) ## S3 method for class 'FODposet' rank_stability(x, selection = 1:length(x$covers), coverage_probability = 0.9, error = 10^(-5), ... )
x |
object of class |
selection |
numeric vector or a vector of names to select the cover matrices in argument |
coverage_probability |
least coverage probability of the rank intervals with extremes |
error |
the "distance" from uniformity in the sampling distribution of linear extensions used to evaluate the average ranks. See |
... |
any of above. |
alpha |
vector of the alpha values defining the alpha-cuts. |
average_ranks |
data frame of average ranks of the poset elements (by columns) at different alpha values (by rows). |
lower_ranks |
data frame of the lower bounds of the rank interval, of each poset element (by columns) at different alpha values (by rows). |
upper_ranks |
data frame of the upper bounds of the rank interval, of each poset element (by columns) at different alpha values (by rows). |
ranking |
data frame of the positions of poset elements (by columns), in the ranking extracted from the posets associated to alpha-cuts (by rows). |
resolution |
number of elements of the posets associated to the alpha-cuts. |
Fattore M., Arcagni A.
v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) x <- FFOD(profiles = prof, distributions = populations) res <- rank_stability(x) res
v1 <- as.ordered(c("a", "b", "c", "d")) v2 <- 1:3 prof <- var2prof(varmod = list(v1 = as.ordered(c("a", "b", "c", "d")), v2 = 1:3)) np <- nrow(prof$profiles) k <- 10 # number of populations set.seed(0) populations <- as.data.frame(lapply(1:k, function(x) round(runif(np)*100))) rownames(populations) <- rownames(prof$profiles) names(populations) <- paste0("P", 1:k) x <- FFOD(profiles = prof, distributions = populations) res <- rank_stability(x) res
The function checks whether the input boolean square matrix m
represents a reflexive binary relation.
reflexivity(m)
reflexivity(m)
m |
a boolean square matrix. |
transitivity
, binary
, antisymmetry
,
validate.partialorder.incidence
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] reflexivity(M)
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] reflexivity(M)
Function to remove profiles from an object of class wprof
.
rmProfiles(y, ...) ## S3 method for class 'wprof' rmProfiles(y, v, ...)
rmProfiles(y, ...) ## S3 method for class 'wprof' rmProfiles(y, v, ...)
y |
object of class |
v |
a vector pointing to the profiles to be removed. The vector can be of type:
|
... |
any of the above. |
The function returns an wprof
object equal to y
but without the
profiles in v
.
vl <- c(3, 3, 3) prof <- var2prof(varlen = vl) rownames(prof$profiles) prof <- rmProfiles(prof, c("123", "321")) plot(prof)
vl <- c(3, 3, 3) prof <- var2prof(varlen = vl) rownames(prof$profiles) prof <- rmProfiles(prof, c("123", "321")) plot(prof)
The function computes a summary of cover and incidence S3 objects. Currently, the function returns just the number of profiles and the number of comparabilities.
## S3 method for class 'cover' summary(object, ...) ## S3 method for class 'incidence' summary(object, ...)
## S3 method for class 'cover' summary(object, ...) ## S3 method for class 'incidence' summary(object, ...)
object |
a cover matrix or an incidence matrix. |
... |
added for consistency with the generic method. |
vl <- c(2, 3, 3) prf <- var2prof(varlen = vl) Z <- getzeta(prf) summary(Z) C <- incidence2cover(Z) summary(C)
vl <- c(2, 3, 3) prf <- var2prof(varlen = vl) Z <- getzeta(prf) summary(Z) C <- incidence2cover(Z) summary(C)
S3 method of function summary
reporting main information for an object of class parsec
,
obtained from function evaluation
.
In particular, the function computes a table showing, for each profile:
the variables' grades identifying the profile (if these are
returned by evaluation
.
the assigned weight.
whether or not it belongs to the threshold.
the corresponding value of the identification function.
the average poverty rank.
the different gap measures (see evaluation
for details).
If the number of profiles is higher than ten, the shown table gets cut, but
the method returns a data.frame
providing the complete output.
## S3 method for class 'parsec' summary(object, ...)
## S3 method for class 'parsec' summary(object, ...)
object |
an object of S3 class |
... |
added for consistency with the generic method. |
profiles <- var2prof(varlen = c(3, 2, 4)) threshold <- c("311", "112") res <- evaluation(profiles, threshold, nit = 10^3) sm <- summary(res) summary(sm)
profiles <- var2prof(varlen = c(3, 2, 4)) threshold <- c("311", "112") res <- evaluation(profiles, threshold, nit = 10^3) sm <- summary(res) summary(sm)
The function computes the transitive closure of a reflexive and antisymmetric binary relation.
transitiveClosure(m)
transitiveClosure(m)
m |
a generic square boolean matrix representing a reflexive and antisymmetric binary relation,
an object of class |
Incidence matrix of the transitive closure of the input matrix m
.
m <- c(1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1) m <- matrix(m, 4, 4) transitiveClosure(m)
m <- c(1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1) m <- matrix(m, 4, 4) transitiveClosure(m)
The function checks whether the boolean square matrix m
representes a transitive binary relation.
transitivity(m)
transitivity(m)
m |
a boolean square matrix. |
binary
, reflexivity
, antisymmetry
,
validate.partialorder.incidence
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] transitivity(M)
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] transitivity(M)
The function computes a boolean vector specifying which poset elements belong to the downset generated by subposet Q
.
upset(z, ...) ## S3 method for class 'cover' upset(z, ...) ## S3 method for class 'incidence' upset(z, Q = NULL, ...)
upset(z, ...) ## S3 method for class 'cover' upset(z, ...) ## S3 method for class 'incidence' upset(z, Q = NULL, ...)
z |
a cover or an incidence matrix, of S3 classes |
Q |
vector specifying a subposet of the poset represented by |
... |
any of the above. |
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] upset(z, Q) Q <- c("211", "112", "111") upset(z, Q)
z <- getzeta(var2prof(varlen = c(2, 2, 2))) plot(z, col = 1 + c(1, 1, 0, 0, 1, 0, 0, 0) + c(0, 0, 0, 2, 0, 0, 2, 2), lwd = 2) Q <- c(4, 7, 8) rownames(z)[Q] upset(z, Q) Q <- c("211", "112", "111") upset(z, Q)
The function checks whether the boolean square matrix m
represents a partial order. If yes, the function returns the same input matrix as a S3 class object incidence
. Otherwise, the unfulfilled partial order properties of matrix m
are returned.
validate.partialorder.incidence(m)
validate.partialorder.incidence(m)
m |
a boolean square matrix. |
transitivity
, binary
, reflexivity
,
antisymmetry
, is.preorder
, is.partialorder
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] M <- validate.partialorder.incidence(M) plot(M)
M <- c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE) M <- matrix(M, 4, 4) rownames(M) <- colnames(M) <- LETTERS[1:4] M <- validate.partialorder.incidence(M) plot(M)
The function computes the list of all of the profiles from a list of input ordinal variables. See details for how to define variables.
var2prof(varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length), freq = NULL, labtype = c("profiles", "progressive"), y=NULL)
var2prof(varmod = lapply(as.list(varlen), function(x) 1:x), varlen = sapply(varmod, length), freq = NULL, labtype = c("profiles", "progressive"), y=NULL)
varmod |
list of variables and their grades. See details. |
varlen |
a vector of number of grades of each variable. See details. |
freq |
profiles frequency distribution. By default, the frequencies are set equal to 1. |
labtype |
type of labels to assign to profiles. See details. |
y |
a matrix of observations, used to count profiles frequencies. See details. |
Variables can be defined through their names and grades, using a list as argument varmod
. The names of the objects in the list are taken as variable names. The objects in the list must be ordered vectors or numeric vectors.
A faster way to define variables is through a vector with the number of grades of each variable, as argument varlen
. This way, variables and their grades are assigned arbitrary names. In particular, grades are identified by their ranks in the variable definition.
The user can choose the type of label to assign to profiles. profiles
is the combination of grades identifying the profiles. When the names of the grades are too long, it is suggested to choose progressive
.
y
is a matrix of observations on the ordinal variables (observations by rows and variables by columns). Variables must be ordered as defined in the previous arguments. The names of variable grades must match their definition. By this argument, the function counts the number of times a profile is observed in the population, assigning the result to the freq
output. This method should be used when the variables and their grades are known, otherwise the function pop2prof
is available.
The function returns a S3 class object wprof
, "weighted profiles", comprising the data.frame
profiles
and the vector of frequencies freq
.
# 2 variables with 2 modalities, frequencies detected from population pop <- matrix(sample(1:2, 100, replace=TRUE), 50, 2) var2prof(varlen=c(2, 2)) # 2 variables: # - mood: 2 modalities # - weather: 3 modalities # 2*3 profiles and frequencies sampled from a Binomial distribution n = 10, p = 0.5 var <- list( mood = ordered(c("bad", "good"), levels = c("bad", "good")), weather = ordered(c("rainy", "cloudy", "sunny"), levels = c("rainy", "cloudy", "sunny")) ) var2prof(var, freq = rbinom(2*3, 10, 0.5), labtype = "progressive")
# 2 variables with 2 modalities, frequencies detected from population pop <- matrix(sample(1:2, 100, replace=TRUE), 50, 2) var2prof(varlen=c(2, 2)) # 2 variables: # - mood: 2 modalities # - weather: 3 modalities # 2*3 profiles and frequencies sampled from a Binomial distribution n = 10, p = 0.5 var <- list( mood = ordered(c("bad", "good"), levels = c("bad", "good")), weather = ordered(c("rainy", "cloudy", "sunny"), levels = c("rainy", "cloudy", "sunny")) ) var2prof(var, freq = rbinom(2*3, 10, 0.5), labtype = "progressive")
The function computes the coordinates of the vertices of the Hasse diagram.
vertices(C, shape = c("square", "circle", "equispaced"), noise = FALSE)
vertices(C, shape = c("square", "circle", "equispaced"), noise = FALSE)
C |
cover matrix, an object of class S3 |
shape |
shape of the diagram. See details. |
noise |
some jittering on the x axis, so as to improve readability. Values can be boolean or positive values, to get different jittering intensities. |
Possible Hasse diagram shapes: square
; circle
; equispaced
. The last option is suggested when the poset has more than one maximal or minimal elements. The function is used by the plot methods defined in the package (see plot.cover
).