# Probability Distributions

Summary: this tutorial shows how to use the various types of probability distributions in FSharp.Stats.

FSharp.Stats provides a wide range of probability distributions. Given the distribution parameters they can be used to investigate their statistical properties or to sample non-uniform random numbers.

For every distribution the probability density function (PDF) and cumulative probability function (CDF) can be accessed. By using the PDF you can access the probability for exactly X=k success states. The CDF is used when the cumulative probabilities of X<=k is required.

## Continuous

### Normal distribution

The normal or Gaussian distribution is a very common continuous probability distribution. Due to the central limit theorem, randomly sampled means of a random and independent distribution tend to approximate a normal distribution It describes the probability, that under a given mean and a given dispersion (standard deviation) an event occurs exactly k times.

It is defined by two parameters N(mu,tau):

• mu = mean
• tau = standard deviation

Example: The distribution of bread weights of a local manufacturer follows a normal distribution with mean 500 g and a standard deviation of 20 g.

NormA: What is the probability of bread weights to be lower than 470 g?

NormB: What is the probability of bread weights to be higher than 505 g?

NormC: Sample independently 10 values from the normal distribution and calculate their mean.

open FSharp.Stats
open FSharp.Stats.Distributions

// Creates a normal distribution with µ = 500 and tau = 20
let normal = Continuous.normal 500. 20.

// NormA: What is the probability of bread weights to be equal or lower than 470 g?
let normA = normal.CDF 470.
// Output: 0.06681 = 6.68 %

// NormB: What is the probability of bread weights to be higher than 505 g?
let normB = 1. - (normal.CDF 505.)
// Output: 0.401294 = 40.13 %

// NormC: Sample independently 10 values from the normal distribution and calculate their mean.
let normC =
Seq.init 10 (fun _ -> normal.Sample())
|> Seq.mean

 492.9854347
// Set a seed so that sampling is reproducible
let seed = 1

List.init 3 (fun _ -> normal.Sample())

 [494.0130671; 496.2549818; 538.0814408]
Random.SetSampleGenerator(Random.RandThreadSafe(seed))
List.init 3 (fun _ -> normal.Sample())

 [494.0130671; 496.2549818; 538.0814408]
// Get back to unseeded sampling
List.init 3 (fun _ -> normal.Sample())

 [479.0807021; 512.2464227; 488.1382404]
open Plotly.NET

//some axis styling
let xAxis() = Axis.LinearAxis.init(Title="x",Mirror=StyleParam.Mirror.All,Ticks=StyleParam.TickOptions.Inside,Showgrid=false,Showline=true)
let yAxis() = Axis.LinearAxis.init(Title="p(X=k)",Mirror=StyleParam.Mirror.All,Ticks=StyleParam.TickOptions.Inside,Showgrid=false,Showline=true)

let plotNormal =
[400. .. 600.]
|> List.map (fun x -> x,normal.PDF x)
|> Chart.Area
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())
|> Chart.withTitle "N(500,20) PDF"

let plotNormalCDF =

[400. .. 600.]
|> List.map (fun x -> x,normal.CDF x)
|> Chart.Area
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())
|> Chart.withTitle "N(500,20) CDF"


### Multivariate normal distribution

Multivariate normal distributions are initialized with a mean vector and a covariance matrix.

let mvn = Continuous.multivariateNormal (vector [-1.;5.]) (matrix [[0.5;1.];[0.25;1.2]])
let axisXRange = [-5. .. 0.2 .. 5.]
let axisYRange = [ 0. .. 0.2 .. 10.]

// probability density function
let mvnPdfs =
axisYRange |> List.map (fun y ->
axisXRange
|> List.map (fun x ->
mvn.PDF (vector [x;y])
)
)

let mvnSamples =
Array.init 1000 (fun _ -> mvn.Sample())

let surface = Chart.Surface(mvnPdfs,axisXRange,axisYRange)

let samples =
mvnSamples
|> Array.map (fun t -> t.[0],t.[1])
|> Array.unzip
|> fun (x,y) -> Chart.Scatter3d(x,y,Array.init x.Length (fun _ -> Random.rndgen.NextFloat() / 3.),StyleParam.Mode.Markers)

let mvnChart =
[surface;samples]
|> Chart.Combine
|> Chart.withTitle "Bivariate normal distribution with sampling"


### Students t distribution

let studentTParams = [(0.,1.,1.);(0.,1.,2.);(0.,1.,5.);]
let xStudentT = [-10. ..0.1.. 10.]

let pdfStudentT mu tau dof =
xStudentT
|> List.map (Continuous.StudentT.PDF mu tau dof)
|> List.zip xStudentT

let cdfStudentT mu tau dof =
xStudentT
|> List.map (Continuous.StudentT.CDF  mu tau dof)
|> List.zip xStudentT

let v =
studentTParams
|> List.map (fun (mu,tau,dof) -> Chart.Spline(pdfStudentT mu tau dof,Name=sprintf "mu=%.1f tau=%.1f dof=%.1f" mu tau dof,ShowMarkers=false))
|> Chart.Combine
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())


## Discrete

### Binomial distribution

The binomial distribution describes the probability, that under a given success probability and a given number of draws an event occurs exactly k times (with replacement).

It is defined by two parameters B(n,p):

• n = number of draws
• p = probability of success

Example: The school bus is late with a probability of 0.10.

BinoA: What is the probability of running late exactly 5 times during a 30 day month?

BinoB: What is the probability of running late for a maximum of 5 times?

BinoC: What is the probability of running late for at least 5 times?

open FSharp.Stats
open FSharp.Stats.Distributions

// Creates a binomial distribution with n=30 and p=0.90
let binomial = Discrete.binomial 0.1 30

// BinoA: What is the probability of running late exactly 5 times during a 30 day month?
let binoA = binomial.PDF 5
// Output: 0.1023 = 10.23 %

// BinoB: What is the probability of running late for a maximum of 5 times?
let binoB = binomial.CDF 5.
// Output: 0.9268 = 92.68 %

// BinoC: What is the probability of running late for at least 5 times?
let binoC = 1. - (binomial.CDF 4.)
// Output: 0.1755 = 17.55 %

let plotBinomial =
[0..30]
|> List.map (fun x -> x,binomial.PDF x)
|> Chart.Column
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())
|> Chart.withTitle "B(30,0.1)"


### Hypergerometric distribution

The hypergeometric distribution describes the probability, that under a given number of success and failure events and a given number of draws an event occurs exactly k times (without replacement).

It is defined by three parameters Hyp(n,s,f):

• n = number of draws
• s = number of success events
• f = number of failure events

Example: You participate in a lottery, where you have to choose 6 numbers out of 49. The lottery queen draws 6 numbers randomly, where the order does not matter.

HypA: What is the probability that your 6 numbers are right?

HypB: What is the probability that you have at least 3 right ones?

HypC: What is the probability that you have a maximum of 3 right ones?

// Creates a hypergeometric distribution with n=6, s=6 and f=49-6=43.
//N=count(succes)+count(failure), K=count(success), n=number of draws
let hyper = Discrete.hypergeometric 49 6 6

// HypA: What is the probability that your 6 numbers are right?
let hypA = hyper.PDF 6
// Output: 7.15-08

// HypB: What is the probability that you have at least 3 right ones?
let hypB = 1. - hyper.CDF 2.
// Output: 0.01864 = 1.86 %

// HypC: What is the probability that you have a maximum of 3 right ones?
let hypC = hyper.CDF 3.
// Output: 0.99901 = 99.90 %


### Poisson distribution

The poisson distribution describes what the probability for a number of events is, occurring in a certain time, area, or volume.

It is defined by just one parameters Po(lambda) where lambda is the average rate.

Example: During a year, a forest is struck by a lightning 5.5 times.

PoA: What is the probability that the lightning strikes exactly 3 times?

PoB: What is the probability that the lightning strikes less than 2 times?

PoC: What is the probability that the lightning strikes more than 7 times?

// Creates a poisson distribution with lambda=  .
let poisson = Discrete.poisson 5.5

// PoA: What is the probability that the lightning strikes exactly 3 times?
let poA = poisson.PDF 3
// Output: 0.11332 = 11.33 %

// PoB: What is the probability that the lightning strikes less or equal to 2 times?
let poB =
// CDF not implemented yet
//poisson.CDF 2.
[0 .. 2] |> List.sumBy poisson.PDF
// Output: 0.088376 = 8.84 %

// PoC: What is the probability that the lightning strikes more than 7 times?
let poC = 1. -  poisson.CDF 6.
// Output: Not implemented yet. Manual addition necessary

let plotPo =
[0..20]
|> List.map (fun x -> x,poisson.PDF x)
|> Chart.Column
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())
//|> Chart.withSize(600.,400.)
|> Chart.withTitle "Po(5.5)"


### Gamma distribution

let gammaParams = [(1.,2.);(2.,2.);(3.,2.);(5.,1.);(9.0,0.5);(7.5,1.);(0.5,1.);]
let xgamma = [0. ..0.1.. 20.]

let pdfGamma a b =
xgamma
|> List.map (Continuous.Gamma.PDF a b)
|> List.zip xgamma

let gammaPlot =
gammaParams
|> List.map (fun (a,b) -> Chart.Point(pdfGamma a b,Name=sprintf "a=%.1f b=%.1f" a b) )//,ShowMarkers=false))
|> Chart.Combine
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())

let cdfGamma a b =
xgamma
|> List.map (Continuous.Gamma.CDF a b)
|> List.zip xgamma

let gammaCDFPlot=
gammaParams
|> List.map (fun (a,b) -> Chart.Spline(cdfGamma a b,Name=sprintf "a=%.1f b=%.1f" a b) )//,ShowMarkers=false))
|> Chart.Combine
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())


## Empirical

You can create empirically derived distributions and sample randomly from these. In this example 100,000 samples from a student t distribution

// Randomly taken samples; in this case from a gaussian normal distribution.
let sampleDistribution =
let template = Continuous.normal 5. 2.
Seq.init 100000 (fun _ -> template.Sample())

//creates an empirical distribution with bandwidth 0.1
let empiricalDistribution =
Empirical.create 0.1 sampleDistribution


## Density estimation

let nv = Array.init 1000 (fun _ -> Distributions.Continuous.Normal.Sample 5. 2.)

let xy = KernelDensity.estimate KernelDensity.Kernel.gaussian 1.0 nv

let kernelChart =
Chart.SplineArea xy
|> Chart.withX_Axis(xAxis())
|> Chart.withY_Axis(yAxis())



## Distance

In this example we will calculate the Wasserstein Metric between 3 distributions. One can imagine this metric as the amount of work needed to move the area (pile of dirt) of one distribution to the area of the other. That's why it's also called Earth Movers Distance.

Be aware that this distance measure is dependent on the actual absolute values of the distributions.

let distribution1 =
let normal = Continuous.normal 300. 15.
Array.init 1000 (fun _ -> normal.Sample())
let distribution2 =
let normal = Continuous.normal 350. 20.
Array.init 500 (fun _ -> normal.Sample())
let distribution3 =
let normal = Continuous.normal 500. 20.
Array.init 1000 (fun _ -> normal.Sample())

let pilesOfDirt =
[
Chart.Histogram(distribution1,Name = "Distribution1")
Chart.Histogram(distribution2,Name = "Distribution2")
Chart.Histogram(distribution3,Name = "Distribution3")
]
|> Chart.Combine

let distance1and2 = Distance.OneDimensional.wassersteinDistance distribution1 distribution2

 49.71097572
let distance1and3 = Distance.OneDimensional.wassersteinDistance distribution1 distribution3

 200.0914454

As expected the distance between Distribution 1 and 2 is the lowest:

let distributions =
[|distribution1;distribution2;distribution3|]

let mapColor min max value =
let proportionR =
((255. - 200.) * (value - min) / (max - min))
|> int
|> fun x -> 255 - x
let proportionG =
((255. - 200.) * (value - min) / (max - min))
|> int
|> fun x -> 255 - x
let proportionB =
((255. - 200.) * (value - min) / (max - min))
|> int
|> fun x -> 255 - x
Colors.fromRgb proportionR proportionG proportionB
|> Colors.toWebColor

let distancesTable =
let distances =
distributions
|> Array.map (fun x ->
distributions
|> Array.map (fun y ->
Distance.OneDimensional.wassersteinDistance x y
|> (sprintf "%.2f")
)
)
|> Array.transpose
|> Array.append [|[|"Distribution1";"Distribution2";"Distribution3"|]|]
|> Array.transpose
let cellColors =
distances
|> Array.mapi (fun i a ->
a
|> Array.mapi (fun j v ->
if j = 0 then
if i = 0 then "#1f77b4"
elif i = 1 then "#ff7f0e"
else "#2ca02c"
else
mapColor 0. 200. (float v)
)
)
|> Array.transpose

Chart.Table(
["";"Distribution1";"Distribution2";"Distribution3"],
distances,
ColorCells = cellColors)

Multiple items
namespace FSharp

--------------------
namespace Microsoft.FSharp
namespace FSharp.Stats
namespace FSharp.Stats.Distributions
val normal : Distribution<float,float>
module Continuous

from FSharp.Stats.Distributions
val normal : mu:float -> sigma:float -> Distribution<float,float>
val normA : float
abstract member Distribution.CDF : 'a -> float
val normB : float
val normC : float
Multiple items
module Seq

from FSharp.Stats

--------------------
module Seq

from Microsoft.FSharp.Collections
val init : count:int -> initializer:(int -> 'T) -> seq<'T>
abstract member Distribution.Sample : unit -> 'b
val mean : items:seq<'T> -> 'U (requires member ( + ) and member get_Zero and member DivideByInt and member ( / ))
val seed : int
module Random

from FSharp.Stats
val SetSampleGenerator : rg:Random.IRandom -> unit
Multiple items
interface IRandom

--------------------
Multiple items
module List

from FSharp.Stats

--------------------
module List

from Microsoft.FSharp.Collections

--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IEnumerable
interface IEnumerable<'T>
member GetReverseIndex : rank:int * offset:int -> int
member GetSlice : startIndex:int option * endIndex:int option -> 'T list
member IsEmpty : bool
member Item : index:int -> 'T with get
member Length : int
...
val init : length:int -> initializer:(int -> 'T) -> 'T list
namespace Plotly
namespace Plotly.NET
val xAxis : unit -> Axis.LinearAxis
module Axis

from Plotly.NET
Multiple items
type LinearAxis =
inherit DynamicObj
new : unit -> LinearAxis
static member init : ?AxisType:AxisType * ?Title:string * ?Titlefont:Font * ?Autorange:AutoRange * ?Rangemode:RangeMode * ?Range:Range * ?RangeSlider:RangeSlider * ?Fixedrange:'a * ?Tickmode:TickMode * ?nTicks:'b * ?Tick0:'c * ?dTick:'d * ?Tickvals:'e * ?Ticktext:'f * ?Ticks:TickOptions * ?Mirror:Mirror * ?Ticklen:'g * ?Tickwidth:'h * ?Tickcolor:'i * ?Showticklabels:'j * ?Tickfont:Font * ?Tickangle:'k * ?Tickprefix:'l * ?Showtickprefix:ShowTickOption * ?Ticksuffix:'m * ?Showticksuffix:ShowTickOption * ?Showexponent:ShowExponent * ?Exponentformat:ExponentFormat * ?Tickformat:'n * ?Hoverformat:'o * ?Showline:bool * ?Linecolor:'p * ?Linewidth:'q * ?Showgrid:bool * ?Gridcolor:'r * ?Gridwidth:'s * ?Zeroline:bool * ?Zerolinecolor:'t * ?Zerolinewidth:'a1 * ?Anchor:AxisAnchorId * ?Side:Side * ?Overlaying:AxisAnchorId * ?Domain:Range * ?Position:float * ?IsSubplotObj:'a2 * ?Tickvalssrc:'a3 * ?Ticktextsrc:'a4 * ?Showspikes:'a5 * ?Spikesides:'a6 * ?Spikethickness:'a7 * ?Spikecolor:'a8 * ?Showbackground:'a9 * ?Backgroundcolor:'a10 * ?Showaxeslabels:'a11 -> LinearAxis
static member style : ?AxisType:AxisType * ?Title:string * ?Titlefont:Font * ?Autorange:AutoRange * ?Rangemode:RangeMode * ?Range:Range * ?RangeSlider:RangeSlider * ?Fixedrange:'a * ?Tickmode:TickMode * ?nTicks:'b * ?Tick0:'c * ?dTick:'d * ?Tickvals:'e * ?Ticktext:'f * ?Ticks:TickOptions * ?Mirror:Mirror * ?Ticklen:'g * ?Tickwidth:'h * ?Tickcolor:'i * ?Showticklabels:'j * ?Tickfont:Font * ?Tickangle:'k * ?Tickprefix:'l * ?Showtickprefix:ShowTickOption * ?Ticksuffix:'m * ?Showticksuffix:ShowTickOption * ?Showexponent:ShowExponent * ?Exponentformat:ExponentFormat * ?Tickformat:'n * ?Hoverformat:'o * ?Showline:bool * ?Linecolor:'p * ?Linewidth:'q * ?Showgrid:bool * ?Gridcolor:'r * ?Gridwidth:'s * ?Zeroline:bool * ?Zerolinecolor:'t * ?Zerolinewidth:'a1 * ?Anchor:AxisAnchorId * ?Side:Side * ?Overlaying:AxisAnchorId * ?Domain:Range * ?Position:float * ?IsSubplotObj:'a2 * ?Tickvalssrc:'a3 * ?Ticktextsrc:'a4 * ?Showspikes:'a5 * ?Spikesides:'a6 * ?Spikethickness:'a7 * ?Spikecolor:'a8 * ?Showbackground:'a9 * ?Backgroundcolor:'a10 * ?Showaxeslabels:'a11 -> (LinearAxis -> LinearAxis)

--------------------
new : unit -> Axis.LinearAxis
static member Axis.LinearAxis.init : ?AxisType:StyleParam.AxisType * ?Title:string * ?Titlefont:Font * ?Autorange:StyleParam.AutoRange * ?Rangemode:StyleParam.RangeMode * ?Range:StyleParam.Range * ?RangeSlider:RangeSlider * ?Fixedrange:'a * ?Tickmode:StyleParam.TickMode * ?nTicks:'b * ?Tick0:'c * ?dTick:'d * ?Tickvals:'e * ?Ticktext:'f * ?Ticks:StyleParam.TickOptions * ?Mirror:StyleParam.Mirror * ?Ticklen:'g * ?Tickwidth:'h * ?Tickcolor:'i * ?Showticklabels:'j * ?Tickfont:Font * ?Tickangle:'k * ?Tickprefix:'l * ?Showtickprefix:StyleParam.ShowTickOption * ?Ticksuffix:'m * ?Showticksuffix:StyleParam.ShowTickOption * ?Showexponent:StyleParam.ShowExponent * ?Exponentformat:StyleParam.ExponentFormat * ?Tickformat:'n * ?Hoverformat:'o * ?Showline:bool * ?Linecolor:'p * ?Linewidth:'q * ?Showgrid:bool * ?Gridcolor:'r * ?Gridwidth:'s * ?Zeroline:bool * ?Zerolinecolor:'t * ?Zerolinewidth:'a1 * ?Anchor:StyleParam.AxisAnchorId * ?Side:StyleParam.Side * ?Overlaying:StyleParam.AxisAnchorId * ?Domain:StyleParam.Range * ?Position:float * ?IsSubplotObj:'a2 * ?Tickvalssrc:'a3 * ?Ticktextsrc:'a4 * ?Showspikes:'a5 * ?Spikesides:'a6 * ?Spikethickness:'a7 * ?Spikecolor:'a8 * ?Showbackground:'a9 * ?Backgroundcolor:'a10 * ?Showaxeslabels:'a11 -> Axis.LinearAxis
module StyleParam

from Plotly.NET
type Mirror =
| True
| Ticks
| False
| All
| AllTicks
static member convert : (Mirror -> obj)
static member toString : (Mirror -> string)
union case StyleParam.Mirror.All: StyleParam.Mirror
type TickOptions =
| Outside
| Inside
| Empty
static member convert : (TickOptions -> obj)
static member toString : (TickOptions -> string)
union case StyleParam.TickOptions.Inside: StyleParam.TickOptions
val yAxis : unit -> Axis.LinearAxis
val plotNormal : GenericChart.GenericChart
val map : mapping:('T -> 'U) -> list:'T list -> 'U list
val x : float
abstract member Distribution.PDF : 'b -> float
type Chart =
static member Area : xy:seq<#IConvertible * #IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:'c -> GenericChart
static member Area : x:seq<#IConvertible> * y:seq<#IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:'a2 -> GenericChart
static member Bar : keysvalues:seq<#IConvertible * #IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart
static member Bar : keys:seq<#IConvertible> * values:seq<#IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart
static member BoxPlot : xy:seq<'a0 * 'a1> * ?Name:string * ?Showlegend:bool * ?Color:string * ?Fillcolor:'a2 * ?Opacity:float * ?Whiskerwidth:'a3 * ?Boxpoints:Boxpoints * ?Boxmean:BoxMean * ?Jitter:'a4 * ?Pointpos:'a5 * ?Orientation:Orientation * ?Marker:Marker * ?Line:Line * ?Alignmentgroup:'a6 * ?Offsetgroup:'a7 * ?Notched:bool * ?NotchWidth:float * ?QuartileMethod:QuartileMethod -> GenericChart
static member BoxPlot : ?x:'a0 * ?y:'a1 * ?Name:string * ?Showlegend:bool * ?Color:string * ?Fillcolor:'a2 * ?Opacity:float * ?Whiskerwidth:'a3 * ?Boxpoints:Boxpoints * ?Boxmean:BoxMean * ?Jitter:'a4 * ?Pointpos:'a5 * ?Orientation:Orientation * ?Marker:Marker * ?Line:Line * ?Alignmentgroup:'a6 * ?Offsetgroup:'a7 * ?Notched:bool * ?NotchWidth:float * ?QuartileMethod:QuartileMethod -> GenericChart
static member Bubble : xysizes:seq<#IConvertible * #IConvertible * #IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:Orientation * ?GroupNorm:GroupNorm * ?UseWebGL:bool -> GenericChart
static member Bubble : x:seq<#IConvertible> * y:seq<#IConvertible> * sizes:seq<#IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:Orientation * ?GroupNorm:GroupNorm * ?UseWebGL:bool -> GenericChart
static member Candlestick : stockTimeSeries:seq<DateTime * StockData> * ?Increasing:Line * ?Decreasing:Line * ?WhiskerWidth:float * ?Line:Line * ?XCalendar:Calendar -> GenericChart
static member Candlestick : open:seq<#IConvertible> * high:seq<#IConvertible> * low:seq<#IConvertible> * close:seq<#IConvertible> * x:seq<#IConvertible> * ?Increasing:Line * ?Decreasing:Line * ?WhiskerWidth:float * ?Line:Line * ?XCalendar:Calendar -> GenericChart
...
static member Chart.Area : xy:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'c -> GenericChart.GenericChart
static member Chart.Area : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'a2 -> GenericChart.GenericChart
static member Chart.withX_Axis : xAxis:Axis.LinearAxis * ?Id:int -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.withY_Axis : yAxis:Axis.LinearAxis * ?Id:int -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.withTitle : title:string * ?Titlefont:Font -> (GenericChart.GenericChart -> GenericChart.GenericChart)
module GenericChart

from Plotly.NET
val toChartHTML : gChart:GenericChart.GenericChart -> string
val plotNormalCDF : GenericChart.GenericChart
val mvn : Distribution<vector,vector>
val multivariateNormal : mu:vector -> sigma:matrix -> Distribution<vector,vector>
Multiple items
val vector : l:seq<float> -> Vector<float>

--------------------
type vector = Vector<float>
Multiple items
val matrix : ll:seq<#seq<float>> -> Matrix<float>

--------------------
type matrix = Matrix<float>
val axisXRange : float list
val axisYRange : float list
val mvnPdfs : float list list
val y : float
val mvnSamples : vector []
Multiple items
module Array

from FSharp.Stats

--------------------
module Array

from Microsoft.FSharp.Collections
val init : count:int -> initializer:(int -> 'T) -> 'T []
val surface : GenericChart.GenericChart
static member Chart.Surface : data:seq<#seq<'b>> * ?X:seq<#System.IConvertible> * ?Y:seq<#System.IConvertible> * ?Name:string * ?Showlegend:bool * ?Opacity:float * ?Contours:'e * ?Colorscale:StyleParam.Colorscale * ?Showscale:bool * ?Colorbar:'f -> GenericChart.GenericChart (requires 'b :> System.IConvertible)
val samples : GenericChart.GenericChart
val map : mapping:('T -> 'U) -> array:'T [] -> 'U []
val t : vector
val unzip : array:('T1 * 'T2) [] -> 'T1 [] * 'T2 []
val x : float []
val y : float []
static member Chart.Scatter3d : xyz:seq<#System.IConvertible * #System.IConvertible * #System.IConvertible> * mode:StyleParam.Mode * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'a3 -> GenericChart.GenericChart
static member Chart.Scatter3d : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * z:seq<#System.IConvertible> * mode:StyleParam.Mode * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'d -> GenericChart.GenericChart
property System.Array.Length: int with get
val mutable rndgen : Random.IRandom
type Mode =
| None
| Lines
| Lines_Markers
| Lines_Text
| Lines_Markers_Text
| Markers
| Markers_Text
| Text
static member convert : (Mode -> obj)
static member toString : (Mode -> string)
union case StyleParam.Mode.Markers: StyleParam.Mode
val mvnChart : GenericChart.GenericChart
static member Chart.Combine : gCharts:seq<GenericChart.GenericChart> -> GenericChart.GenericChart
val studentTParams : (float * float * float) list
val xStudentT : float list
val pdfStudentT : mu:float -> tau:float -> dof:float -> (float * float) list
val mu : float
val tau : float
val dof : float
type StudentT =
static member CDF : mu:float -> tau:float -> dof:float -> x:float -> float
static member Mean : mu:float -> tau:float -> dof:float -> float
static member PDF : mu:float -> tau:float -> dof:float -> x:float -> float
static member Sample : mu:float -> tau:float -> dof:float -> float
static member StandardDeviation : mu:float -> tau:float -> dof:float -> float
static member Support : mu:float -> tau:float -> dof:float -> float * float
static member Variance : mu:float -> tau:float -> dof:float -> float
static member Continuous.StudentT.PDF : mu:float -> tau:float -> dof:float -> x:float -> float
val zip : list1:'T1 list -> list2:'T2 list -> ('T1 * 'T2) list
val cdfStudentT : mu:float -> tau:float -> dof:float -> (float * float) list
static member Continuous.StudentT.CDF : mu:float -> tau:float -> dof:float -> x:float -> float
val v : GenericChart.GenericChart
static member Chart.Spline : xy:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'c * ?Smoothing:float * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
static member Chart.Spline : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'a2 * ?Smoothing:float * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
val sprintf : format:Printf.StringFormat<'T> -> 'T
val binomial : Distribution<float,int>
module Discrete

from FSharp.Stats.Distributions
val binomial : p:float -> n:int -> Distribution<float,int>
val binoA : float
val binoB : float
val binoC : float
val plotBinomial : GenericChart.GenericChart
val x : int
static member Chart.Column : keysvalues:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'c * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart.GenericChart
static member Chart.Column : keys:seq<#System.IConvertible> * values:seq<#System.IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart.GenericChart
val hyper : Distribution<float,int>
val hypergeometric : N:int -> K:int -> n:int -> Distribution<float,int>
val hypA : float
val hypB : float
val hypC : float
val plotHyper : GenericChart.GenericChart
val poisson : Distribution<float,int>
val poisson : lambda:float -> Distribution<float,int>
val poA : float
val poB : float
val sumBy : projection:('T -> 'U) -> list:'T list -> 'U (requires member ( + ) and member get_Zero)
val poC : float
val plotPo : GenericChart.GenericChart
val gammaParams : (float * float) list
val xgamma : float list
val pdfGamma : a:float -> b:float -> (float * float) list
val a : float
val b : float
type Gamma =
static member CDF : alpha:float -> beta:float -> x:float -> float
static member Mean : alpha:float -> beta:float -> float
static member PDF : alpha:float -> beta:float -> x:float -> float
static member Sample : alpha:float -> beta:float -> float
static member StandardDeviation : alpha:float -> beta:float -> float
static member Support : alpha:float -> beta:float -> float * float
static member Variance : alpha:float -> beta:float -> float
static member Continuous.Gamma.PDF : alpha:float -> beta:float -> x:float -> float
val gammaPlot : GenericChart.GenericChart
static member Chart.Point : xy:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
static member Chart.Point : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
val cdfGamma : a:float -> b:float -> (float * float) list
static member Continuous.Gamma.CDF : alpha:float -> beta:float -> x:float -> float
val gammaCDFPlot : GenericChart.GenericChart
val sampleDistribution : seq<float>
val template : Distribution<float,float>
Multiple items
module Seq

from FSharp.Stats

--------------------
module Seq

from Plotly.NET

--------------------
module Seq

from Microsoft.FSharp.Collections
val empiricalDistribution : Map<float,float>
module Empirical

from FSharp.Stats.Distributions
val create : bandwidth:float -> data:seq<float> -> Map<float,float>
val plotEmpirical : GenericChart.GenericChart
val getZip : pmf:Map<float,float> -> seq<float * float>
val nv : float []
type Normal =
static member CDF : mu:float -> sigma:float -> x:float -> float
static member Estimate : samples:seq<float> -> Distribution<float,float>
static member Mean : mu:float -> sigma:float -> float
static member PDF : mu:float -> sigma:float -> x:float -> float
static member Sample : mu:float -> sigma:float -> float
static member StandardDeviation : mu:float -> sigma:float -> float
static member Support : mu:float -> sigma:float -> float * float
static member Variance : mu:float -> sigma:float -> float
static member init : mu:float -> sigma:float -> Distribution<float,float>
static member Continuous.Normal.Sample : mu:float -> sigma:float -> float
val xy : (float * float) []
module KernelDensity

from FSharp.Stats.Distributions
val estimate : kernel:KernelDensity.DensityKernel -> bandwidth:float -> data:float array -> (float * float) []
module Kernel

from FSharp.Stats.Distributions.KernelDensity
val gaussian : bw:float -> x:float -> float
val kernelChart : GenericChart.GenericChart
static member Chart.SplineArea : xy:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'c * ?Smoothing:'d -> GenericChart.GenericChart
static member Chart.SplineArea : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:StyleParam.DrawingStyle * ?Width:'a2 * ?Smoothing:'a3 -> GenericChart.GenericChart
val distribution1 : float []
val distribution2 : float []
val distribution3 : float []
val pilesOfDirt : GenericChart.GenericChart
static member Chart.Histogram : data:seq<#System.IConvertible> * ?Orientation:StyleParam.Orientation * ?Name:string * ?Showlegend:bool * ?Opacity:float * ?Color:string * ?HistNorm:StyleParam.HistNorm * ?HistFunc:StyleParam.HistNorm * ?nBinsx:int * ?nBinsy:int * ?Xbins:Bins * ?Ybins:Bins * ?xError:'b * ?yError:'c -> GenericChart.GenericChart
val distance1and2 : float
module Distance

from FSharp.Stats.Distributions
module OneDimensional

from FSharp.Stats.Distributions.Distance
val wassersteinDistance : xs:float [] -> ys:float [] -> float
val distance1and3 : float
val distributions : float [] []
val mapColor : min:float -> max:float -> value:float -> string
val min : float
val max : float
val value : float
val proportionR : int
Multiple items
val int : value:'T -> int (requires member op_Explicit)

--------------------
type int = int32

--------------------
type int<'Measure> = int
val proportionG : int
val proportionB : int
module Colors

from Plotly.NET
val fromRgb : r:int -> g:int -> b:int -> Colors.Color
val toWebColor : c:Colors.Color -> string
val distancesTable : GenericChart.GenericChart
val distances : string [] []
val transpose : arrays:seq<'T []> -> 'T [] []
val append : array1:'T [] -> array2:'T [] -> 'T []
val cellColors : string [] []
val mapi : mapping:(int -> 'T -> 'U) -> array:'T [] -> 'U []
val i : int
val a : string []
val j : int
val v : string
Multiple items
val float : value:'T -> float (requires member op_Explicit)

--------------------
type float = System.Double

--------------------
type float<'Measure> = float
static member Chart.Table : headerValues:seq<#seq<'b>> * cellValues:seq<#seq<'d>> * ?AlignHeader:seq<StyleParam.HorizontalAlign> * ?AlignCells:seq<StyleParam.HorizontalAlign> * ?ColumnWidth:seq<int> * ?ColumnOrder:seq<int> * ?ColorHeader:'e * ?ColorCells:'f * ?FontHeader:Font * ?FontCells:Font * ?HeightHeader:'g * ?HeightCells:'h * ?LineHeader:Line * ?LineCells:Line -> GenericChart.GenericChart (requires 'b :> System.IConvertible and 'd :> System.IConvertible)