| Copyright | (c) 2025 |
|---|---|
| License | MIT |
| Maintainer | mschavinda@gmail.com |
| Safe Haskell | None |
| Language | GHC2021 |
Granite.Stat
Description
Statistical transforms (Stat). Each runs on a layer's mapped X / Y
columns and returns a new frame, generally with the same column names
holding the transformed values. StatBoxplot additionally writes
__ymin __q1 __median __q3 __ymax for the boxplot
geom to read.
Synopsis
- applyStat :: Stat -> Mapping -> DataFrame -> DataFrame
- binData :: BinSpec -> [Double] -> ([Double], [Double])
- kdeData :: Int -> [Double] -> ([Double], [Double])
- smoothLm :: [Double] -> [Double] -> [Double]
- smoothMovingAvg :: Int -> [Double] -> [Double]
- smoothLoess :: Double -> [Double] -> [Double] -> [Double]
- boxplotSummary :: [Double] -> BoxStats
- data BoxStats = BoxStats {}
- countByCategory :: [Text] -> [(Text, Int)]
- summarizeByCategory :: SummaryFun -> [(Text, Double)] -> [(Text, Double)]
Documentation
kdeData :: Int -> [Double] -> ([Double], [Double]) Source #
Gaussian KDE on n grid points; bandwidth is Silverman's rule.
smoothLm :: [Double] -> [Double] -> [Double] Source #
OLS regression, evaluated at the input X positions.
smoothMovingAvg :: Int -> [Double] -> [Double] Source #
Trailing moving average; leading edge is the partial-window mean so the output length matches the input.
smoothLoess :: Double -> [Double] -> [Double] -> [Double] Source #
LOESS-style local linear regression with tricube weights;
span_ is the neighbourhood fraction in (0, 1].
boxplotSummary :: [Double] -> BoxStats Source #
Five-number summary using Tukey hinges: when n is odd the
median is included in both halves, so boxplotSummary [1..9]
gives (1, 3, 5, 7, 9).
Constructors
| BoxStats | |
summarizeByCategory :: SummaryFun -> [(Text, Double)] -> [(Text, Double)] Source #