This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-03
Channels
- # announcements (1)
- # babashka (31)
- # bangalore-clj (3)
- # beginners (18)
- # bitcoin (2)
- # calva (14)
- # clj-kondo (37)
- # clojure (43)
- # clojure-europe (4)
- # clojurescript (24)
- # data-science (4)
- # datahike (1)
- # datascript (3)
- # datomic (1)
- # fulcro (16)
- # lsp (13)
- # malli (1)
- # meander (7)
- # off-topic (1)
- # polylith (12)
- # re-frame (7)
- # reitit (1)
- # rewrite-clj (46)
- # rum (4)
- # shadow-cljs (15)
- # specter (3)
- # sql (55)
- # tools-deps (20)
Hi everyone 🙂, how do I get the confidence interval in Clojure. Like with a list of data of orders each week `[40 0 60 30 ...]` which corresponds to each week based on index. I understand for mean, I can just reduce the data to get the sum and divide by number of weeks
fastmath
lib has some functions for that: https://github.com/generateme/fastmath/blob/382ec27d23fbaf8925a088c5d5edc27e4596dd0d/src/fastmath/stats.clj#L407-L442
I, as an exercise, also did a naive implementation of confidence interval here: https://github.com/jumarko/clojure-experiments/blob/master/src/clojure_experiments/stats/confidence_intervals.clj#L69
Bear in mind that I'm a noob in statistics but I hope you find these links useful
Thanks @U06BE1L6T for mentioning fastmath. There are also other types of intervals (or extents) based on different statistics. In the newest version we have BCa which returns corrected CI for skewed data: https://github.com/generateme/fastmath/blob/4779e6457ba82b5c3ec5f43d9104fc8edebb1b36/src/fastmath/stats.clj#L1065 (thanks to @U01HZPM4P5X)
Thanks @U1EP3BZ3Q @U06BE1L6T! I just went with ci
it is good enough for my purposes! Am glad I managed to use clojure for my stochastic modelling assignment :D