Statistical transform functions for use inside #dt/e expressions.
These functions operate on column vectors (dtype readers) and return a column of the same length. They are the runtime implementations for stat/* symbols parsed by datajure.expr.
All functions are nil-safe: nil values in the input are skipped when computing reference statistics (mean, sd, percentiles), and nil inputs produce nil outputs in the returned column.
Statistical transform functions for use inside #dt/e expressions. These functions operate on column vectors (dtype readers) and return a column of the same length. They are the runtime implementations for stat/* symbols parsed by datajure.expr. All functions are nil-safe: nil values in the input are skipped when computing reference statistics (mean, sd, percentiles), and nil inputs produce nil outputs in the returned column.
(stat-demean col)Demean a column: x - mean(x), element-wise. nil values are preserved as nil.
Demean a column: x - mean(x), element-wise. nil values are preserved as nil.
(stat-standardize col)Standardize a column: (x - mean) / sd, element-wise. nil values are preserved as nil. Returns nil for entire column if sd is zero.
Standardize a column: (x - mean) / sd, element-wise. nil values are preserved as nil. Returns nil for entire column if sd is zero.
(stat-winsorize col p)Winsorize a column at the given tail probability p (0 < p < 0.5). Values below the p-th percentile are clipped to that percentile; values above the (1-p)-th percentile are clipped to that percentile. nil values are preserved as nil. Example: (stat/winsorize :ret 0.01) clips the bottom and top 1%.
Winsorize a column at the given tail probability p (0 < p < 0.5). Values below the p-th percentile are clipped to that percentile; values above the (1-p)-th percentile are clipped to that percentile. nil values are preserved as nil. Example: (stat/winsorize :ret 0.01) clips the bottom and top 1%.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |