diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index aedc80cc..5588da7d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fsdocs-tool": { - "version": "15.0.0", + "version": "16.1.1", "commands": [ "fsdocs" ] diff --git a/docs/Distributions.fsx b/docs/Distributions.fsx index 0d3f8cef..67fee68f 100644 --- a/docs/Distributions.fsx +++ b/docs/Distributions.fsx @@ -276,8 +276,11 @@ fPDFs (***hide***) fPDFs |> GenericChart.toChartHTML (***include-it-raw***) + (** + *) + let cdfF a b = xF |> List.map (Continuous.F.CDF a b) diff --git a/docs/GoodnessOfFit.fsx b/docs/GoodnessOfFit.fsx index ba5dde65..23c78081 100644 --- a/docs/GoodnessOfFit.fsx +++ b/docs/GoodnessOfFit.fsx @@ -58,6 +58,7 @@ open FSharp.Stats open FSharp.Stats.Fitting open LinearRegression.OrdinaryLeastSquares open GoodnessOfFit.OrdinaryLeastSquares.Linear.Univariable +open FSharp.Stats.Distributions //data sorted by x values let x = vector [|1. .. 10.|] @@ -121,7 +122,7 @@ let stdErrIntercept = GoodnessOfFit.standardErrorIntercept sos //standard error of the estimate (S) let stdErrEstimate = GoodnessOfFit.standardErrorEstimate sos //confidence intervals (df = n-#coefficients; a=5%) -let criticalT = Distributions.Continuous.getCriticalTValue (n - 2.) 0.05 Distributions.Continuous.TwoTailed +let criticalT = ContinuousDistribution.getCriticalTValue (n - 2.) 0.05 ContinuousDistribution.TwoTailed let lowerS = slope - criticalT * stdErrSlope let upperS = slope + criticalT * stdErrSlope let lowerI = intercept - criticalT * stdErrIntercept diff --git a/docs/GrowthCurve.fsx b/docs/GrowthCurve.fsx index a5867353..1357c7f3 100644 --- a/docs/GrowthCurve.fsx +++ b/docs/GrowthCurve.fsx @@ -239,7 +239,7 @@ let fittingFunction = let fittedValuesGompertz = - /// The parameter were determined locally for saving time during build processes + // The parameter were determined locally for saving time during build processes //let f = Table.GrowthModels.gompertz.GetFunctionValue (vector [|16.46850199; 0.7014917539; 7.274139441; 3.3947717|]) [time.[0] .. 0.1 .. Seq.last time] |> Seq.map (fun x -> @@ -360,7 +360,7 @@ let generationtimeRichards (richardParameters:vector) = log(2.) / maximalSlope let fittedValuesRichards = - /// The parameter were determined locally for saving time during build processes + // The parameter were determined locally for saving time during build processes let f = Table.GrowthModels.richards.GetFunctionValue (vector [|23.25211263; 7.053516315; 5.646889803; 111.0132522|]) [time.[0] .. 0.1 .. Seq.last time] |> Seq.map (fun x -> @@ -441,7 +441,7 @@ let generationtimeWeibull (weibullParameters:vector) = log(2.) / maximalSlope let fittedValuesWeibull = - /// The parameter were determined locally for saving time during build processes + // The parameter were determined locally for saving time during build processes let f = Table.GrowthModels.weibull.GetFunctionValue (vector [|16.40632433; 23.35537293; 0.2277752116; 2.900806071|]) [time.[0] .. 0.1 .. Seq.last time] |> Seq.map (fun x -> @@ -526,7 +526,7 @@ let generationtimeJanoschek (janoschekParameters:vector) = log(2.) / maximalSlope let fittedValuesJanoschek = - /// The parameter were determined locally for saving time during build processes + // The parameter were determined locally for saving time during build processes let f = Table.GrowthModels.janoschek.GetFunctionValue (vector [|16.40633962; 23.35535182; 0.01368422994; 2.900857027|]) [time.[0] .. 0.1 .. Seq.last time] |> Seq.map (fun x -> @@ -604,7 +604,7 @@ let generationtimeExponential (expParameters:vector) = log(2.) / maximalSlope let fittedValuesExp = - /// The parameter were determined locally for saving time during build processes + // The parameter were determined locally for saving time during build processes let f = Table.GrowthModels.exponential.GetFunctionValue (vector [|4.813988967; 24.39950361; 0.3939132175|]) [3.0 .. 0.1 .. Seq.last time] |> Seq.map (fun x -> @@ -692,7 +692,7 @@ let generationtimeVerhulst (verhulstParameters:vector) = log(2.) / maximalSlope let fittedValuesVerhulst = - /// The parameter were determined locally for saving time during build processes + // The parameter were determined locally for saving time during build processes let f = Table.GrowthModels.verhulst4Param.GetFunctionValue (vector [|23.39504328; 3.577488116; 1.072136278; 15.77380824|]) [time.[0] .. 0.1 .. Seq.last time] |> Seq.map (fun x -> @@ -780,7 +780,7 @@ let generationMmf = sprintf "The generation time (MMF) is: %.1f min" (generationtimeMmf (vector [|16.46099291; 24.00147463; 0.2500698772; 3.741048641|]) * 60.) let fittedValuesMMF = - /// The parameter were determined locally for saving time during build processes + // The parameter were determined locally for saving time during build processes let f = Table.GrowthModels.morganMercerFlodin.GetFunctionValue (vector [|16.46099291; 24.00147463; 0.2500698772; 3.741048641|]) [time.[0] .. 0.1 .. Seq.last time] |> Seq.map (fun x -> diff --git a/src/FSharp.Stats.Interactive/FSharp.Stats.Interactive.fsproj b/src/FSharp.Stats.Interactive/FSharp.Stats.Interactive.fsproj index c4e70774..dca322b6 100644 --- a/src/FSharp.Stats.Interactive/FSharp.Stats.Interactive.fsproj +++ b/src/FSharp.Stats.Interactive/FSharp.Stats.Interactive.fsproj @@ -14,7 +14,7 @@ Kevin Schneider, fslab open source contributors - FSharp.Stats + FSharp.Stats.Interactive fslaborg, Timo Muehlhaus A .NET Interactive Kernel Extension for displaying FSharp.Stats types and objects. https://fslab.org/FSharp.Stats diff --git a/src/FSharp.Stats/Intervals.fs b/src/FSharp.Stats/Intervals.fs index af522f86..6b90f4a5 100644 --- a/src/FSharp.Stats/Intervals.fs +++ b/src/FSharp.Stats/Intervals.fs @@ -203,7 +203,7 @@ module Intervals = ///// Get a percentage how far inside (0.0 - 1.0) or outside (< 0.0, > 1.0) the interval a certain value lies. ///// For single intervals, '1.0' is returned when inside the interval, '-1.0' otherwise. ///// -///// The position value to get the percentage for. +///// The position value to get the percentage for. ///// The percentage indicating how far inside (or outside) the interval the given value lies. //let getPercentageFor position r = // let inside = liesInInterval position r @@ -282,8 +282,8 @@ module Intervals = ///// Returns an expanded interval of the current interval up to the given value. ///// When the value lies within the interval the returned interval is the same. ///// -///// The value up to which to expand the interval. -///// Include the value to which is expanded in the interval. +///// The value up to which to expand the interval. +///// Include the value to which is expanded in the interval. //let expandTo a = // failwith "not implemented" // diff --git a/src/FSharp.Stats/SpecialFunctions/Beta.fs b/src/FSharp.Stats/SpecialFunctions/Beta.fs index 0fb0e5e1..a977ba51 100644 --- a/src/FSharp.Stats/SpecialFunctions/Beta.fs +++ b/src/FSharp.Stats/SpecialFunctions/Beta.fs @@ -160,18 +160,14 @@ module Beta = exp t - ///// - ///// Inverse of incomplete beta integral. - ///// + // Inverse of incomplete beta integral. //let incompleteInverse aa bb yy0 = // aa //TODO: Beta into class to allow [] - ///// - ///// Multinomial Beta function. - ///// + // Multinomial Beta function. //let multinomial ([] x:float[]) = // let mutable sum = 0. // let mutable prd = 1. diff --git a/src/FSharp.Stats/SpecialFunctions/Binomial.fs b/src/FSharp.Stats/SpecialFunctions/Binomial.fs index 8f191ac0..c945c12f 100644 --- a/src/FSharp.Stats/SpecialFunctions/Binomial.fs +++ b/src/FSharp.Stats/SpecialFunctions/Binomial.fs @@ -12,8 +12,8 @@ module Binomial = /// /// The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input /// - //input for n in the computation of (n | k) - //input for k in the computation of (n | k) + ///input for n in the computation of (n | k) + ///input for k in the computation of (n | k) let _coeffcient (n:int) (k:int) = if ( n < 0 || k < 0 || k > n) then invalidArg "Binomial.coeffcient" "" if (n < 171) then @@ -31,8 +31,8 @@ module Binomial = /// /// This might be slower than the unchecked version `_coefficient` but does not require input sanitation to get expected results for these cases. /// - //input for n in the computation of (n | k) - //input for k in the computation of (n | k) + ///input for n in the computation of (n | k) + ///input for k in the computation of (n | k) let coeffcient (n:int) (k:int) = if ( n < 0 || k < 0 || k > n) then invalidArg "Binomial.coeffcient" "" if (n < 171) then @@ -48,8 +48,8 @@ module Binomial = /// /// The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input /// - //input for n in the computation of ln(n | k) - //input for k in the computation of ln(n | k) + ///input for n in the computation of ln(n | k) + ///input for k in the computation of ln(n | k) let _coeffcientLn (n:int) (k:int) = if ( n < 0 || k < 0 || k > n) then invalidArg "Binomial.coeffcient" "" (Factorial._factorialLn n) - (Factorial._factorialLn k) - (Factorial._factorialLn (n-k)) @@ -63,8 +63,8 @@ module Binomial = /// /// This might be slower than the unchecked version `_coefficient` but does not require input sanitation to get expected results for these cases. /// - //input for n in the computation of ln(n | k) - //input for k in the computation of ln(n | k) + ///input for n in the computation of ln(n | k) + ///input for k in the computation of ln(n | k) let coeffcientLn (n:int) (k:int) = if ( n < 0 || k < 0 || k > n) then invalidArg "Binomial.coeffcient" "" (Factorial.factorialLn n) - (Factorial.factorialLn k) - (Factorial.factorialLn (n-k)) diff --git a/src/FSharp.Stats/SpecialFunctions/Factorial.fs b/src/FSharp.Stats/SpecialFunctions/Factorial.fs index 1cbf5e0e..9f170aa4 100644 --- a/src/FSharp.Stats/SpecialFunctions/Factorial.fs +++ b/src/FSharp.Stats/SpecialFunctions/Factorial.fs @@ -40,8 +40,8 @@ module Factorial = /// The factorial functions takes an int x and returns x!. This function will not overflow /// /// the floating point format as long as x is at most 170, and will return +infinity for all values > 170 - /// - ///The input to compute x! + /// + ///The input to compute x! let factorial (x:int) = if x <= FactorialMax then FactorialCache.[x] @@ -54,8 +54,8 @@ module Factorial = /// Values will be approximated for x > 170, as the approximated _gammaLn function is used to obtain the results for large inputs. /// /// The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input - /// - ///The input to compute x! + /// + ///The input to compute x! let _factorialLn (x: int) : float = if x < 0 then failwith "Log factorial not defined for n < 0" //if x <= 1 then 0.0 else Gamma.gammaLn ((float x) + 1.0) @@ -72,8 +72,8 @@ module Factorial = /// Edge cases in the input (nan, infinity, and -infinity) are catched and handled. /// /// This might be slower than the unchecked version `_factorialLn` but does not require input sanitation to get expected results for these cases. - /// - ///The input to compute x! + /// + ///The input to compute x! let factorialLn (x: int) : float = if x < 0 then failwith "Log factorial not defined for n < 0" //if x <= 1 then 0.0 else Gamma.gammaLn ((float x) + 1.0) diff --git a/src/FSharp.Stats/SpecialFunctions/Gamma.fs b/src/FSharp.Stats/SpecialFunctions/Gamma.fs index 67cc6302..6789dbb0 100644 --- a/src/FSharp.Stats/SpecialFunctions/Gamma.fs +++ b/src/FSharp.Stats/SpecialFunctions/Gamma.fs @@ -38,7 +38,7 @@ module Gamma = /// /// /// The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input - /// + /// /// The function input for approximating ln(Γ(z)) let _gammaLn z = let lanczosCoefficients = [76.18009172947146;-86.50532032941677;24.01409824083091;-1.231739572450155;0.1208650973866179e-2;-0.5395239384953e-5]