FSharp.Stats


Special Functions

Gamma

Factorial

Beta

Error Function

Logistics

Binomial

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 
64: 
65: 
66: 
67: 
68: 
69: 
70: 
71: 
72: 
73: 
74: 
75: 
76: 
77: 
78: 
//#r "D:/Source/FSharp.Stats/bin/FSharp.Stats.dll"
#r "FSharp.Stats.dll"
//open FSharp
open FSharp.Stats

let xgamma = [-4. ..0.05.. 4.]
let ygamma = xgamma |> List.map SpecialFunctions.Gamma.gamma

List.zip xgamma ygamma
|> Chart.Spline
|> Chart.withY_AxisStyle("gamma",MinMax=(-4.,4.))
|> Chart.withX_AxisStyle("x")
|> Chart.withSize (500., 450.)


let xgammaLn = [0.01 ..0.1.. 5.]
let ygammaLn = xgammaLn |> List.map SpecialFunctions.Gamma.gammaLn

List.zip xgammaLn ygammaLn
|> Chart.Spline
|> Chart.withY_AxisStyle("log gamma",MinMax=(-4.,4.))
|> Chart.withX_AxisStyle("x")
|> Chart.withSize (500., 450.)



let agammaInc = [0.5;1.;5.;10.;]
let xgammaInc = [0. .. 0.5 .. 20.]
let ygammaInc a = 
    xgammaInc 
    |> List.map (fun x -> SpecialFunctions.Gamma.lowerIncomplete a x) 
    |> List.zip xgammaInc

agammaInc
|> List.map (fun a -> Chart.Spline(ygammaInc a,Name=sprintf "a=%.1f" a,ShowMarkers=false))
|> Chart.Combine
|> Chart.withY_AxisStyle("lower incomplete gamma P(a,x)")
|> Chart.withY_AxisStyle("x")
|> Chart.withSize (500., 450.)




let agammaInc' = [0.5;1.;5.;10.;]
let xgammaInc' = [0. .. 0.1 .. 20.]
let ygammaInc' a = 
    xgammaInc' 
    |> List.map (fun x -> SpecialFunctions.Gamma.upperIncomplete a x) 
    |> List.zip xgammaInc'

agammaInc'
|> List.map (fun a -> Chart.Spline(ygammaInc' a,Name=sprintf "a=%.1f" a,ShowMarkers=false))
|> Chart.Combine
|> Chart.withY_AxisStyle("upper incomplete gamma P(a,x)")
|> Chart.withY_AxisStyle("x")
|> Chart.withSize (500., 450.)





// Beta functions
// ==============


let betaParam = [(0.5,0.5);(5.,1.);(1.,3.);(2.,2.);(2.,5.);]
let xbeta = [0. ..0.05.. 1.]
let betainc a b = 
    xbeta 
    |> List.map (SpecialFunctions.Beta.lowerIncomplete a b)
    |> List.zip xbeta

betaParam
|> List.map (fun (a,b) -> Chart.Spline(betainc a b,Name=sprintf "a=%.1f b=%.1f" a b,ShowMarkers=false))
|> Chart.Combine
//|> Chart.withY_AxisStyle("beta",MinMax=(-4.,4.))
//|> Chart.withX_AxisStyle("x")
|> Chart.withSize (500., 450.)
namespace Microsoft.FSharp
val xgamma : float list
val ygamma : obj list
Multiple items
module List

from Microsoft.FSharp.Collections

--------------------
type List<'T> =
  | ( [] )
  | ( :: ) of Head: 'T * Tail: 'T list
    interface IReadOnlyList<'T>
    interface IReadOnlyCollection<'T>
    interface IEnumerable
    interface IEnumerable<'T>
    member GetSlice : startIndex:int option * endIndex:int option -> 'T list
    member Head : 'T
    member IsEmpty : bool
    member Item : index:int -> 'T with get
    member Length : int
    member Tail : 'T list
    ...
val map : mapping:('T -> 'U) -> list:'T list -> 'U list
val zip : list1:'T1 list -> list2:'T2 list -> ('T1 * 'T2) list
val xgammaLn : float list
val ygammaLn : obj list
val agammaInc : float list
val xgammaInc : float list
val ygammaInc : a:'a -> (float * 'b) list
val a : 'a
val x : float
val a : float
val sprintf : format:Printf.StringFormat<'T> -> 'T
val agammaInc' : float list
val xgammaInc' : float list
val ygammaInc' : a:'a -> (float * 'b) list
val betaParam : (float * float) list
val xbeta : float list
val betainc : a:'a -> b:'b -> (float * 'c) list
val b : 'b
val b : float
Fork me on GitHub