Trees | Indices | Help |
|
---|
|
Properties of the permutations (null distribution) for inversions of a totally-ordered sequence. Includes: max, mean, variance, similarity, correlation, and counts of permutations with k inversions (called I_n[k] in some literature).
Author: Benjamin D. Nye License: Apache License V2.0
|
|||
InversionCountsCache A cache for managing stored inversion count calculations |
|
|||
list of int |
|
||
float |
|
||
int |
|
||
float |
|
||
list of int |
|
||
float |
|
||
float |
|
|
|||
__loader__ = <zipimporter object "C:\Python27\lib\site-package
|
|||
__package__ = None
|
|
Calculate the count of the number of permutations with k inversions, as a vector of Inv(n,k) in the form [Inv(n,0), Inv(n,1), ..., Inv(n,k_max)] where n is the length of the sequence and k_max is the maximum inversions. Note: This implementation can be bootstrapped using a startingPoint, to avoid calculating known inversions (as the algorithm works through iterative transforms)
|
Correlation between sequences, given the inversions and max possible A correlation of -1 is the worst, while 1 is the best. This value is equivalent to a Kendall's Tau correlation.
|
Maximum inversions for a permutation of a sequence of n elements Note: This will always return an integer
|
Mean (expected) inversions for a permutation of a sequence of n elements Note: This returns a float, as the expectation maybe fractional.
|
Get the count of the number of permutations with k inversions, as a vector of Inv(n,k) in the form [Inv(n,0), Inv(n,1), ..., Inv(n,k_max)] where n is the length of the sequence and k_max is the maximum inversions Note: This implementation uses the InversionCountsCache to boost speed
|
Similarity between sequences, given the inversions and max possible A similarity of 0 is the worst, while 1 is the best.
|
Variance of inversions for a permutation of a sequence of n elements Note: This returns a float, as the variance maybe fractional.
|
|
__loader__
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Sep 07 17:01:43 2014 | http://epydoc.sourceforge.net |