FsLab
FsLab copied to clipboard
Generic extension to visualize FSharp.Stats distributions with Plotly.NET
Description
This is a 'glue' function that reduces friction between usage of FSharp.Stats and Plotly.NET.
When working with distributions, it is quite common to visualize either properties (e.g. PDF, CDF) or a sample. This would ideally work in a smooth pipeline, where a Distribution.toChart
function transforms the input distribution to a chart, which can then further be used in the pipeline for additional styling, etc. before display
(the following is just a rough draft, might be not directly possible to implement it like this)
Distributions.Continuous.Normal.Init 500. 20.
|> Distribution.toPDFChart(
Range = [400. .. 600.]
)
|> Chart.withXAxisStyle(...)
|> Chart.withYAxisStyle(...)
Pointers
- The FSharp.Stats documentation has many examples where plots are created for distributions manually.