Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/BasicStats.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
(*** condition: ipynb ***)
Expand Down
2 changes: 1 addition & 1 deletion docs/Clustering.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
6 changes: 3 additions & 3 deletions docs/ComparisonMetrics.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand All @@ -27,7 +27,7 @@ Plotly.NET.Defaults.DefaultDisplayOptions <-
#if IPYNB
#r "nuget: Plotly.NET, 4.0.0"
#r "nuget: Plotly.NET.Interactive, 4.0.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#r "nuget: FSharp.Stats"
#endif // IPYNB

Expand Down Expand Up @@ -154,7 +154,7 @@ let mlcm =
[2; 0; 4]
]
|> array2D
|> Matrix.Generic.ofArray2D
|> Matrix.ofArray2D
)
)
(**
Expand Down
6 changes: 3 additions & 3 deletions docs/Correlation.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"


Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand All @@ -29,7 +29,7 @@ Plotly.NET.Defaults.DefaultDisplayOptions <-
#r "nuget: Plotly.NET, 4.0.0"
#r "nuget: Plotly.NET.Interactive, 4.0.0"
#r "nuget: FSharp.Stats"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#endif // IPYNB

(**
Expand Down
2 changes: 1 addition & 1 deletion docs/Covariance.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
6 changes: 3 additions & 3 deletions docs/CrossValidation.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down Expand Up @@ -357,7 +357,7 @@ let shuffleAndSplitPolynomial p iterations (xData: Vector<float>) (yData: Vector
let getFitFuncPol xTrain yTrain (xTest:Vector<float>) =
getFitFuncPolynomial xTrain yTrain xTest order

CrossValidation.shuffelAndSplit p iterations xDataMat yData getFitFuncPol error Seq.stDev
CrossValidation.shuffleAndSplit p iterations xDataMat yData getFitFuncPol error Seq.stDev

//creates an output for 5 iterations where random 20 % of the data set are taken as testing data set
let sasPolynomial order = shuffleAndSplitPolynomial 0.2 5 xV yV order
Expand All @@ -368,7 +368,7 @@ let shuffleAndSplitSpline p iterations (xData: Vector<float>) (yData: Vector<flo
let getFitFuncSpl xDat yDat (xDatTrain: Vector<float>) =
getFitFuncSpline xDat yDat xDatTrain lambda

CrossValidation.shuffelAndSplit p iterations xDataMat yData getFitFuncSpl errorSpl Seq.stDev
CrossValidation.shuffleAndSplit p iterations xDataMat yData getFitFuncSpl errorSpl Seq.stDev

//creates an output for 5 iterations where random 20 % of the data set are taken as testing data set
let sasSpline lambda = shuffleAndSplitSpline 0.2 5 xV yV lambda
Expand Down
2 changes: 1 addition & 1 deletion docs/Differentiation.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Distributions.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#r "nuget: Plotly.NET, 4.0.0"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
Expand Down
2 changes: 1 addition & 1 deletion docs/Fitting.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/GoodnessOfFit.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/GrowthCurve.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions docs/Imputation.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand All @@ -28,7 +28,7 @@ Plotly.NET.Defaults.DefaultDisplayOptions <-
#r "nuget: Plotly.NET, 4.0.0"
#r "nuget: Plotly.NET.Interactive, 4.0.0"
#r "nuget: FSharp.Stats"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
open FsMath

open Plotly.NET
Expand Down
2 changes: 1 addition & 1 deletion docs/Integration.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Interpolation.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Intervals.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Normalization.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Optimization.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Quantiles.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Rank.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Signal.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Testing.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categoryindex: 0
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/index.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#r "nuget: FSharpAux, 2.0.0"
#r "nuget: FSharpAux.IO, 2.0.0"
#r "nuget: OptimizedPriorityQueue, 5.1.0"
#r "nuget: FsMath, 0.0.1"
#r "nuget: FsMath, 0.0.2"
#I "../src/FSharp.Stats/bin/Release/.net8.0/"
#r "FSharp.Stats.dll"
#r "nuget: Plotly.NET, 4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions src/FSharp.Stats/Distributions/Continuous/StudentT.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ type StudentT =

// Student's T-distribution helper functions.
static member CheckParam mu tau dof =
if System.Double.IsNaN(mu) || tau < 0.0 || System.Double.IsNaN(dof) || dof < 0. then
if isNan(mu) || tau < 0.0 || isNan(dof) || dof < 0. then
failwith "Student's T-distribution should be parametrized by mu, tau and dof > 0.0."

/// <summary>Computes the mode.</summary>
/// <remarks></remarks>
/// <param name="mu"></param>
Expand Down
5 changes: 2 additions & 3 deletions src/FSharp.Stats/Distributions/Discrete/Hypergeometric.fs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ type Hypergeometric =
static member ToString N K n =
sprintf "Hypergeometric(N = %i, K = %i, n = %i)" N K n

/// <summary> Initializes a hypergeometric distribution.
///
/// <summary>
/// <summary>
/// Initializes a hypergeometric distribution.
/// The hypergeometric distribution is a discrete probability distribution
/// that describes the probability of `k` successes (random draws for which the object
/// drawn has a specified feature) in `n` draws, without replacement, from a finite
Expand Down
7 changes: 3 additions & 4 deletions src/FSharp.Stats/Distributions/Discrete/NegativeBinomial.fs
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,10 @@ type NegativeBinomial_failures =
static member ToString r p =
sprintf "NegativeBinomial_failures(r = %i, p = %f)" r p

/// <summary> Initializes a negative binomial distribution.
/// <summary>The negative binomial distribution is a discrete probability distribution<br />that models the number of failures needed k to get the rth success in repeated <br />independent Bernoulli trials with probability p.<br /></summary><br /><param name="r">The number of success states</param><br /><param name="p">The probability of each independent bernoulli trial</param><br /><param name="k">The number of failures before the rth success</param></summary>
/// <summary> Initializes a negative binomial distribution.<br /> The negative binomial distribution is a discrete probability distribution<br />that models the number of failures needed k to get the rth success in repeated <br />independent Bernoulli trials with probability p.<br /></summary>
/// <remarks></remarks>
/// <param name="r"></param>
/// <param name="p"></param>
/// <param name="r">The number of success states</param>
/// <param name="p">The probability of each independent bernoulli trial</param>
/// <returns></returns>
/// <example>
/// <code>
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Stats/FSharp.Stats.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<PackageReference Include="FSharpAux.Core" Version="2.0.0" />
<PackageReference Include="FSharpAux" Version="2.0.0" />
<PackageReference Include="FSharpAux.IO" Version="2.0.0" />
<PackageReference Include="FsMath" Version="0.0.1" />
<PackageReference Include="FsMath" Version="0.0.2" />
<PackageReference Include="OptimizedPriorityQueue" Version="5.1.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/FSharp.Stats/Fitting/CrossValidation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ module CrossValidation =
/// <summary>Computes a repeated shuffel-and-split cross validation<br />p: percentage of training set size from original size,<br />iterations: number of random subset creation,<br />xData: rowwise x-coordinate matrix,<br />yData: yData vector<br />fit: x and y data lead to function that maps a xData row vector to a y-coordinate,<br />error: defines the error of the fitted y-coordinate and the actual y-coordinate,<br />getStDev: function that calculates the standard deviation from a seq&lt;^T&gt;. (Seq.stDev)</summary>
/// <remarks></remarks>
/// <param name="p"></param>
/// <param name="iterations"></param>
/// <param name="xData"></param>
/// <param name="yData"></param>
/// <param name="fit"></param>
Expand Down
1 change: 1 addition & 0 deletions src/FSharp.Stats/Fitting/LinearRegression.fs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ module LinearRegression =
/// Returns the regression function of a line through the origin
/// </summary>
/// <param name="coef">The functions slope</param>
/// <param name="x">x value of which the corresponding y value should be predicted</param>
/// <returns>Function that takes a x value and returns the predicted y value</returns>
/// <example>
/// <code>
Expand Down
1 change: 1 addition & 0 deletions src/FSharp.Stats/Fitting/LogisticRegression.fs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ module LogisticRegression =
/// <summary>Returns the regression function</summary>
/// <remarks></remarks>
/// <param name="coef"></param>
/// <param name="x"></param>
/// <returns></returns>
/// <example>
/// <code>
Expand Down
5 changes: 5 additions & 0 deletions src/FSharp.Stats/ML/Imputation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ module Imputation =
/// <summary>Imputation by random sampling from the input vector</summary>
/// <remarks></remarks>
/// <param name="rnd"></param>
/// <param name="fdata"></param>
/// <param name="index"></param>
/// <returns></returns>
/// <example>
/// <code>
Expand Down Expand Up @@ -71,6 +73,9 @@ module Imputation =
/// <summary>Imputation by k-nearest neighbour</summary>
/// <remarks></remarks>
/// <param name="k"></param>
/// <param name="data"></param>
/// <param name="arr"></param>
/// <param name="index"></param>
/// <returns></returns>
/// <example>
/// <code>
Expand Down
3 changes: 3 additions & 0 deletions src/FSharp.Stats/ML/Unsupervised/ClusterNumber.fs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ module ClusterNumber =
/// <summary>Akaike Information Criterion (AIC)</summary>
/// <remarks></remarks>
/// <param name="bootstraps"></param>
/// <param name="iClustering"></param>
/// <param name="maxK"></param>
/// <returns></returns>
/// <example>
/// <code>
Expand Down Expand Up @@ -299,6 +301,7 @@ https://www.datanovia.com/en/lessons/determining-the-optimal-number-of-clusters-
/// <summary>Generate uniform points within the range of `data`.</summary>
/// <remarks></remarks>
/// <param name="rnd"></param>
/// <param name="data"></param>
/// <returns></returns>
/// <example>
/// <code>
Expand Down
2 changes: 2 additions & 0 deletions src/FSharp.Stats/ML/Unsupervised/KNN.fs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ module KNN =
/// Predict (or classify) the given point.
/// </summary>
/// <param name="x">the point to be classified.</param>
/// <param name="overwriteK"></param>
/// <example>
/// <code>
/// // .. construct and fit the knnClassifier before ..
Expand All @@ -221,6 +222,7 @@ module KNN =
/// Predict (or classify) the given collection of points.
/// </summary>
/// <param name="points">the array of points to be classified.</param>
/// <param name="overwriteK"></param>
/// <example>
/// <code>
/// // .. construct and fit the knnClassifier before ..
Expand Down
Loading