Functions in this group form the basis for the statistics (\ref jkqtptools_math_statistics ) and linear algebra libraries (\ref jkqtptools_math_linalg ), by providing allocation and freeing of (aligned) memory arrays.
\see JKQTPlotterBasicJKQTPDatastoreStatistics
\defgroup jkqtptools_math_linalg Linear Algebra Tools
This group assembles a basic set of linear algebra methods, including matrix inversion, which are required e.g. by the statistics library (\ref jkqtptools_math_statistics )
This group contains a statistics library, which offers several basic methods and is based on an iterator interface:
- \ref jkqtptools_math_statistics_basic
- \ref jkqtptools_math_statistics_grouped
- \ref jkqtptools_math_statistics_regression
- \ref jkqtptools_math_statistics_poly
- \ref jkqtptools_math_statistics_1dhist
- \ref jkqtptools_math_statistics_2dhist
- \ref jkqtptools_math_statistics_1dkde
- \ref jkqtptools_math_statistics_2dkde
.
In addition there is a set of "adaptors" (see \ref jkqtptools_math_statistics_adaptors ) that shortcut the calculation of a statistical property and the subsequent parametrization of a plot with the results. With these adaptors you can add e.g. a boxplot or histogram chart to a plot by calling only one function.
All statistics functions use an iterator-based interface, comparable to the interface of the <a href="http://www.cplusplus.com/reference/algorithm/">algorithms in the C++ standard template library</a>. To this end, the class `JKQTPDatastore` provides an iterator interface to its columns, using the functions `JKQTPDatastore::begin()` and `JKQTPDatastore::end()`. Both functions simply receive the column ID as parameter and exist in a const and a mutable variant. the latter allows to also edit the data. In addition the function `JKQTPDatastore::backInserter()` returns a back-inserter iterator (like generated for STL containers with `std::back_inserter(container)`) that also allows to append to the column.
Note that the iterator interface allows to use these functions with any container that provides such iterators (e.g. `std::vector<double>`, `std::list<int>`, `std::set<float>`, `QVector<double>`...).
Code using one of these statistics functions therefore may look e.g. like this:
All statistics functions use all values in the given range and convert each value to a `double`, using `jkqtp_todouble()`. The return values is always a dohble. Therefore you can use these functions to calculate statistics of ranges of any type that can be converted to `double`. Values that do not result in a valid `double`are not used in calculating the statistics. Therefore you can exclude values by setting them `JKQTP_DOUBLE_NAN` (i.e. "not a number").
\see see for detailed examples: \ref JKQTPlotterBasicJKQTPDatastoreStatistics