+ Made the drawings relative to the canvas, not to the screen.
- Removed the mean line, as it didn't play nice with the ability to change upper and lower boundaries.
Things to note:
- The code has comments. I feel protective of these comments, and feel that they help structure the code and will help me out when I come I come back to this code a couple of weeks or months from now.
- Originally based on code by Evan Ward (probability.dev). See also: observablehq.com/@nunosempere/distribution-drawer
To do, in order of importance:
- Add the ability to change the upper and lower boundaries.
- Make the drawings relative to the canvas, not to the screen.
- Add other features from probability.dev
Cool things yet to be done:
- Make it so that one can input a guesstimate function, and then draw on it. To do this, use the Convert.xyShapeToCanvasShape and modify the Draw.initial distribution function slightly.
- Maybe reach out to Metaculus to see if they want to use this somewhere?
- Makes the distributions bigger, much bigger, so that I can better see them.
- To do that, and to be able to see the input string at the same time I destroys the cdf.
- My brain wasn't really made for interpreting cdfs, and I can switch to the cdf view if I want.
- Changes the distribution color to a bright, happy and shiny blue, so that I can better see them.
- Adds a standard distribution with more personality.
- A getMean and getVariance in each module of src/distPlus/distribution/Distributions.re
- They get the exact answer for the functions in Distributions.re, according to the approximation used.
- There is now an XYShape.Analysis.integrateContinuousShape function.
- Tests in the __tests__/Distributions__Test.re function.
- Calculation of the mean and variance for the normal and lognnormal distributions, at the end.
- I also added some reduce array functions to the E.A. module.