Performs a complete and exact rank analysis of a given partial ranking.
This includes rank probabilities, relative rank probabilities and expected ranks.

exact_rank_prob(P, only.results = T, verbose = F, force = F)

## Arguments

P |
A partial ranking as matrix object calculated with neighborhood_inclusion
or positional_dominance. |

only.results |
Logical. return only results (default) or additionally
the ideal tree and lattice if `FALSE` . |

verbose |
Logical. should diagnostics be printed. Defaults to `FALSE` . |

force |
Logical. If `FALSE` (default), stops the analysis if the partial
ranking has more than 40 elements and less than 0.4 comparable pairs.
Only change if you know what you are doing. |

## Value

lin.extNumber of possible rankings that extend `P`

.

mseArray giving the equivalence classes of `P`

.

rank.probMatrix containing rank probabilities: `rank.prob[u,k]`

is the probability that u has rank k.

relative.rankMatrix containing relative rank probabilities: `relative.rank[u,v]`

is the probability that u is ranked lower than v.

expected.rankExpected ranks of nodes in any centrality ranking.

rank.spreadStandard deviation of the ranking probabilities.

topo.orderRandom ranking used to build the lattice of ideals (if `only.results = FALSE`

).

treeAdjacency list (incoming) of the tree of ideals (if `only.results = FALSE`

).

latticeAdjacency list (incoming) of the lattice of ideals (if `only.results = FALSE`

).

idealsList of order ideals (if `only.results = FALSE`

).

In all cases, higher numerical ranks imply a higher position in the ranking. That is,
the lowest ranked node has rank 1.

## Details

The function derives rank probabilities from a given partial ranking
(for instance returned by neighborhood_inclusion or positional_dominance). This includes the
calculation of expected ranks, (relative) rank probabilities and the number of possible rankings.
Note that the set of rankings grows exponentially in the number of elements and the exact
calculation becomes infeasible quite quickly and approximations need to be used.
See `vignette("benchmarks")`

for guidelines and approx_rank_relative,
approx_rank_expected, and mcmc_rank_prob for approximative methods.

## References

De Loof, K. 2009. Efficient computation of rank probabilities in posets.
*Phd thesis*, Ghent University.

De Loof, K., De Meyer, H. and De Baets, B., 2006. Exploiting the
lattice of ideals representation of a poset. *Fundamenta Informaticae*, 71(2,3):309-321.

## See also

## Examples

#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 0 1 1 1
#> [2,] 0 0 0 1 0
#> [3,] 0 0 0 0 1
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0

#> Warning: P is already a ranking.
#> Expected Ranks correspond to the only possible ranking.