clumpiness-0.17.0.2: Calculate the clumpiness of leaf properties in a tree

Math.Clumpiness.Algorithms

Synopsis

# Documentation

geomAvg :: [Double] -> Double Source #

Get the geometric average of a list

Weigh the nodes by what weight they have (based on the product of the number of children their parents have, see leavesParentMult in tree-fun) and invert it

relevantList :: Eq a => a -> a -> [(a, Int)] -> [Int] Source #

Only look at these properties, if they aren't both in the list (or if p1 == p2 and the length is 1), then ignore it

relevantMap :: (Ord a, Ord b) => b -> b -> PropertyMap a b -> Map a c -> Map a c Source #

Only look at these properties, if they aren't both in the list (or if p1 == p2 and the length is 1), then ignore it, Map version. Ignore nodes not in propertyMap

relevantMapSame :: (Ord a, Ord b) => b -> PropertyMap a b -> Map a c -> Map a c Source #

Only look at these properties, if they aren't both in the list (or if p1 == p2 and the length is 1 meaning that there is no other leaf of any other type), then ignore it. Ignore nodes not in propertyMap

getNodeClumpiness :: (Ord a, Ord b) => b -> b -> PropertyMap a b -> Tree (SuperNode a) -> Double Source #

Get the clumpiness of a single node. Ignore the root node. Only count p1 == p2 case when there are at least one set of neighboring leaves in order to account for the extreme cases (complete mixture, complete separation of properties) which are throwing off the p1 == p2 case. So explicitly calculate cases where the number of descendent leaves is 2. Ignore nodes not in propertyMap

getPropertyClumpiness :: (Ord a, Ord b) => b -> b -> PropertyMap a b -> Tree (SuperNode a) -> Double Source #

Get the clumpiness metric (before sample size correction)

generateClumpMap :: (Ord a, Ord b) => (b -> Bool) -> PropertyMap a b -> Tree (SuperNode a) -> ClumpList b Source #

Get the heatmap for the clumping metric, how "clumped together" the properties are. Found by counting the parents whose descendent leaves are of those properties. They are weighted by how far away those leaves are. Remove any unwanted properties by having the "viable" function take in a property and return if it is viable or not. The PropertyMap should have all of the vertices within the tree but no more --- any additional and the clumpiness changes as the sample sizes change --- so this property has not been tested and so it may lead to new ways of viewing clumpiness.