|
tatami_stats
Matrix statistics for tatami
|
Compute statistics from a tatami::Matrix while skipping NaNs.
More...
Classes | |
| struct | GroupRssBuffers |
Result buffers for skip_nan::group_rss(). More... | |
| struct | GroupRssOptions |
Options for skip_nan::group_rss(). More... | |
| struct | GroupRssResult |
Results of skip_nan::group_rss(). More... | |
| struct | RangeBuffers |
Result buffers for skip_nan::range(). More... | |
| struct | RangeOptions |
Options for range(). More... | |
| struct | RangeResult |
Results of skip_nan::range(). More... | |
| struct | RssBuffers |
Result buffers for skip_nan::rss(). More... | |
| struct | RssOptions |
Options for skip_nan::rss(). More... | |
| struct | RssResult |
Results of skip_nan::rss(). More... | |
Functions | |
| template<typename Value_ , typename Index_ , typename Group_ , typename Output_ , typename Count_ > | |
| void | group_rss (bool row, const tatami::Matrix< Value_, Index_ > &mat, const Group_ *const group, const Group_ num_groups, const GroupRssBuffers< Output_, Count_ > &output, const GroupRssOptions< Output_ > &opt) |
| template<typename Output_ , typename Count_ , typename Value_ , typename Index_ , typename Group_ > | |
| GroupRssResult< Output_, Count_ > | group_rss (bool row, const tatami::Matrix< Value_, Index_ > &mat, const Group_ *const group, const Group_ num_groups, const GroupRssOptions< Output_ > &opt) |
| template<typename Output_ > | |
| constexpr Output_ | default_minimum_placeholder () |
| template<typename Output_ > | |
| constexpr Output_ | default_maximum_placeholder () |
| template<typename Value_ , typename Index_ , typename Output_ , typename Count_ > | |
| void | range (bool row, const tatami::Matrix< Value_, Index_ > &mat, RangeBuffers< Output_, Count_ > &output, const RangeOptions< Output_ > &opt) |
| template<typename Value_ , typename Index_ , typename Output_ = Value_, typename Count_ = Index_> | |
| RangeResult< Output_, Count_ > | range (bool row, const tatami::Matrix< Value_, Index_ > &mat, const RangeOptions< Output_ > &opt) |
| template<typename Value_ , typename Index_ , typename Output_ , typename Count_ > | |
| void | rss (bool row, const tatami::Matrix< Value_, Index_ > &mat, RssBuffers< Output_, Count_ > &output, const RssOptions< Output_ > &opt) |
| template<typename Output_ = double, typename Count_ , typename Value_ , typename Index_ > | |
| RssResult< Output_, Count_ > | rss (bool row, const tatami::Matrix< Value_, Index_ > &mat, const RssOptions< Output_ > &opt) |
Compute statistics from a tatami::Matrix while skipping NaNs.
| void tatami_stats::skip_nan::group_rss | ( | bool | row, |
| const tatami::Matrix< Value_, Index_ > & | mat, | ||
| const Group_ *const | group, | ||
| const Group_ | num_groups, | ||
| const GroupRssBuffers< Output_, Count_ > & | output, | ||
| const GroupRssOptions< Output_ > & | opt ) |
Compute per-group variances for each element of a chosen dimension of a tatami::Matrix.
| Value_ | Numeric type of the matrix value. |
| Index_ | Integer type of the row/column indices. |
| Group_ | Integer type of the group assignments for each row/column. |
| Output_ | Floating-point type of the output value. |
| Count_ | Numeric type of the non-NaN counts. This is typically an integer type. |
| row | Whether to compute variances for the rows. | |
| mat | Instance of a tatami::Matrix. | |
| [in] | group | Pointer to an array of length equal to the number of columns (if row = true) or rows (otherwise). Each value should be an integer that specifies the group assignment. Values should lie in \([0, N)\) where \(N\) is the number of unique groups. |
| num_groups | Number of groups, i.e., \(N\). | |
| [out] | output | Buffers in which to store the results. On output, each array stores the means and variances of the corresponding group. |
| opt | Further options. |
| GroupRssResult< Output_, Count_ > tatami_stats::skip_nan::group_rss | ( | bool | row, |
| const tatami::Matrix< Value_, Index_ > & | mat, | ||
| const Group_ *const | group, | ||
| const Group_ | num_groups, | ||
| const GroupRssOptions< Output_ > & | opt ) |
Compute per-group variances for each element of a chosen dimension of a tatami::Matrix.
| Output_ | Floating-point type of the output value. |
| Count_ | Numeric type of the non-NaN counts. This is typically an integer type. |
| Value_ | Numeric type of the matrix value. |
| Index_ | Integer type of the row/column indices. |
| Group_ | Integer type of the group assignments for each row/column. |
| row | Whether to compute variances for the rows. | |
| mat | Instance of a tatami::Matrix. | |
| [in] | group | Pointer to an array of length equal to the number of columns (if row = true) or rows (otherwise). Each value should be an integer that specifies the group assignment. Values should lie in \([0, N)\) where \(N\) is the number of unique groups. |
| num_groups | Number of groups, i.e., \(N\). | |
| opt | Further options. |
|
constexpr |
| Output_ | Numeric type of the output of skip_nan::range(). |
skip_nan::range(). This is positive infinity if supported by Output_, otherwise it is the largest finite value.
|
constexpr |
| Output_ | Numeric type of the output of skip_nan::range(). |
skip_nan::range(). This is negative infinity if supported by Output_, otherwise it is the smallest finite value. | void tatami_stats::skip_nan::range | ( | bool | row, |
| const tatami::Matrix< Value_, Index_ > & | mat, | ||
| RangeBuffers< Output_, Count_ > & | output, | ||
| const RangeOptions< Output_ > & | opt ) |
Compute ranges for each element of a chosen dimension of a tatami::Matrix, after skipping any NaNs.
| Value_ | Numeric type of the input data. |
| Index_ | Integer type of the row/column indices. |
| Output_ | Numeric type of the output data. It is assumed that this is large enough to store the maxima/minima. |
| Count_ | Numeric type of the non-NaN counts. This is typically an integer type. |
| row | Whether to compute the range for each row. If false, the range is computed for each column instead. | |
| mat | Instance of a tatami::Matrix. | |
| [out] | output | Buffers to output arrays. On output, this will contain the row/column variances. |
| opt | Further options. |
| RangeResult< Output_, Count_ > tatami_stats::skip_nan::range | ( | bool | row, |
| const tatami::Matrix< Value_, Index_ > & | mat, | ||
| const RangeOptions< Output_ > & | opt ) |
Overload of skip_nan::range() that allocates memory for the minimum/maximum.
| Value_ | Numeric type of the input data. |
| Index_ | Integer type of the row/column indices. |
| Output_ | Numeric type of the output data. It is assumed that this is large enough to store the maxima/minima. |
| row | Whether to compute the range for each row. If false, the range is computed for each column instead. |
| mat | Instance of a tatami::Matrix. |
| opt | Further options. |
| void tatami_stats::skip_nan::rss | ( | bool | row, |
| const tatami::Matrix< Value_, Index_ > & | mat, | ||
| RssBuffers< Output_, Count_ > & | output, | ||
| const RssOptions< Output_ > & | opt ) |
Compute residual sums of squares (RSS) for each element of a chosen dimension of a tatami::Matrix, after skipping any NaNs. This may use either Welford's method or the standard two-pass method, depending on the dimension in row and the preferred access dimension of p.
| Value_ | Numeric type of the input data. |
| Index_ | Integer type of the row/column indices. |
| Output_ | Floating-point type of the output data. |
| Count_ | Numeric type of the non-NaN counts. This is typically an integer type. |
| row | Whether to compute the RSS for each row. If false, the RSS is computed for each column instead. | |
| mat | Instance of a tatami::Matrix. | |
| [out] | output | Buffers to output arrays. On output, this will contain the row/column RSSs. |
| opt | Further options. |
| RssResult< Output_, Count_ > tatami_stats::skip_nan::rss | ( | bool | row, |
| const tatami::Matrix< Value_, Index_ > & | mat, | ||
| const RssOptions< Output_ > & | opt ) |
Overload of skip_nan::rss() that allocates memory for the output arrays.
| Output_ | Floating-point type of the output data. |
| Count_ | Numeric type of the non-NaN counts. This is typically an integer type. |
| Value_ | Numeric type of the input data. |
| Index_ | Integer type of the row/column indices. |
| row | Whether to compute the RSS for each row. If false, the RSS is computed for each column instead. |
| mat | Instance of a tatami::Matrix. |
| opt | Further options. |