# API documentation

Module | Description |
---|---|

dstats.alloc | Stuff having to do with memory management. Mostly a copy of RegionAllocator for now until it gets into Phobos, as well as some RegionAllocator-specific data structures. |

dstats.base | Relatively low-level primitives on which to build higher-level math/stat functionality. Some are used internally, some are just things that may be useful to users of this library. This module is starting to take on the appearance of a small utility library. |

dstats.cor | Pearson, Spearman and Kendall correlations, covariance. |

dstats.distrib | Probability distribution CDFs, PDFs/PMFs, and a few inverse CDFs. |

dstats.infotheory | Basic information theory. Joint entropy, mutual information, conditional mutual information. This module uses the base 2 definition of these quantities, i.e, entropy, mutual info, etc. are output in bits. |

dstats.kerneldensity | This module contains a small but growing library for performing kernel density estimation. |

dstats.pca | This module contains a basic implementation of principal component analysis, based on the NIPALS algorithm. This is fast when you only need the first few components (which is usually the case since PCA's main uses are visualization and dimensionality reduction). However, convergence slows drastically after the first few components have been removed and most of the matrix is just noise. |

dstats.random | Generates random samples from a various probability distributions. These are mostly D ports of the NumPy random number generators. |

dstats.regress | A module for performing linear regression. This module has an unusual interface, as it is range-based instead of matrix based. Values for independent variables are provided as either a tuple or a range of ranges. This means that one can use, for example, map, to fit high order models and lazily evaluate certain values. (For details, see examples below.) |

dstats.sort | A comprehensive sorting library for statistical functions. Each function takes N arguments, which are arrays or array-like objects, sorts the first and sorts the rest in lockstep. For merge and insertion sort, if the last argument is a ulong*, increments the dereference of this ulong* by the bubble sort distance between the first argument and the sorted version of the first argument. This is useful for some statistical calculations. |

dstats.summary | Summary statistics such as mean, median, sum, variance, skewness, kurtosis. Except for median and median absolute deviation, which cannot be calculated online, all summary statistics have both an input range interface and an output range interface. |

dstats.tests | Hypothesis testing beyond simple CDFs. All functions work with input ranges with elements implicitly convertible to double unless otherwise noted. |

dstats | Convenience module that simply publicly imports everything else. |