Skip to content

Commit 3ab5545

Browse files
docs: prepare documentation and README for 0.8.0 release
- Bump SPM install example to 0.8.0 in README - Remove runtime complexity estimates from all doc comments - Rename 'Combinatorial Extensions' catalog page to 'Mathematical Functions' and add missing beta and gamma function entries - Fix 'Centeral Tendency' filename typo - Remove empty topic sections from StatKit.md and Distributions.md - Move FiskDistribution to a dedicated Type Aliases group - Expand RankingStrategy case doc comments with examples - Add missing doc comment to NormalDistribution.init(mean:standardDeviation:) - Add deprecation note to GammaDistribution.init(alpha:beta:)
1 parent a8739f7 commit 3ab5545

19 files changed

Lines changed: 57 additions & 57 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ To install StatKit using the [Swift Package Manager](https://swift.org/package-m
130130
let package = Package(
131131
...
132132
dependencies: [
133-
.package(url: "https://github.com/JimmyMAndersson/StatKit.git", from: "0.6.0")
133+
.package(url: "https://github.com/JimmyMAndersson/StatKit.git", from: "0.8.0")
134134
],
135135
...
136136
)

Sources/StatKit/Descriptive Statistics/Association/Correlation.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public extension Collection {
88
///
99
/// Since there is no notion of correlation in collections with less than two elements,
1010
/// this method returns NaN if the array count is less than two.
11-
/// The time complexity of this method is O(n).
1211
@inlinable
1312
func pearsonR<T, U>(
1413
of X: KeyPath<Element, T>,
@@ -52,7 +51,6 @@ public extension Collection {
5251
/// Since there is no notion of correlation in collections with less than two
5352
/// elements or when one of the variables are constant,
5453
/// this method returns NaN if the array count is less than two.
55-
/// The time complexity of this method is O(n).
5654
@inlinable
5755
func spearmanR<T, U>(
5856
of X: KeyPath<Element, T>,
@@ -119,7 +117,6 @@ public extension Collection {
119117
///
120118
/// Since there is no notion of correlation in collections with less than two elements,
121119
/// this method returns NaN if the array count is less than two.
122-
/// The time complexity of this method is O(n).
123120
func kendallTau<T, U>(
124121
of X: KeyPath<Element, T>,
125122
and Y: KeyPath<Element, U>,

Sources/StatKit/Descriptive Statistics/Central Tendency/Averages.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ public extension Collection {
55
/// - returns: The mean of all items.
66
///
77
/// Since the arithmetic mean has no meaning on an empty set, this method returns a NaN if the collection is empty.
8-
/// The time complexity of this method is O(n).
98
@inlinable
109
func mean<T: ConvertibleToReal>(
1110
variable: KeyPath<Element, T>,
@@ -24,8 +23,6 @@ public extension Collection {
2423
///
2524
/// - important: This method has undefined behavior on collections containing elements that are incomparable.
2625
/// For example, an array containing NaN's will produce unpredictable results.
27-
///
28-
/// - complexity: O(n log n), where n is the length of the collection.
2926
@inlinable
3027
func median<T: Comparable & ConvertibleToReal>(
3128
variable: KeyPath<Element, T>,
@@ -49,8 +46,6 @@ public extension Collection {
4946
///
5047
/// - important: This method has undefined behavior on collections containing elements that are incomparable.
5148
/// For example, an array containing NaN's will produce unpredictable results.
52-
///
53-
/// - complexity: O(n), where n is the length of the collection.
5449
@inlinable
5550
func mode<T: Hashable>(
5651
variable: KeyPath<Element, T>

Sources/StatKit/Descriptive Statistics/Central Tendency/MeanStrategy.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ extension MeanStrategy {
1717
/// - parameter variable: The random variable for which to calculate the mean.
1818
/// - parameter collection: The collection of values.
1919
/// - returns: The specified mean value.
20-
/// The time complexity of this method is O(n).
2120
@usableFromInline
2221
internal func compute<C: Collection, T: ConvertibleToReal>(
2322
for variable: KeyPath<C.Element, T>,

Sources/StatKit/Descriptive Statistics/Central Tendency/MedianStrategy.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ extension MedianStrategy {
1313
/// - parameter variable: The random variable for which to calculate the mean.
1414
/// - parameter collection: The collection of values.
1515
/// - returns: The specified mean value.
16-
///
17-
/// - complexity: O(n log n), where n is the length of the collection.
1816
@usableFromInline
1917
internal func compute<T, C>(
2018
for variable: KeyPath<C.Element, T>,

Sources/StatKit/Descriptive Statistics/Dispersion/Range.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ public extension Collection {
66
/// - returns: The range of the selected variable.
77
///
88
/// The range is the difference between the lowest and highest number in a collection.
9-
/// The time complexity of this method is O(n).
109
func range<T: Comparable & ConvertibleToReal>(
1110
of variable: KeyPath<Element, T>
1211
) -> Double {

Sources/StatKit/Descriptive Statistics/Dispersion/Variability.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ public extension Collection {
55
/// - parameter variable: The variable over which to calculate the variance.
66
/// - parameter composition: The composition of the collection.
77
/// - returns: The variance of the collection.
8-
///
9-
/// The time complexity of this method is O(n).
108
@inlinable
119
func variance<T: ConvertibleToReal>(
1210
variable: KeyPath<Element, T>,
@@ -39,8 +37,6 @@ public extension Collection {
3937
/// - parameter variable: The variable over which to calculate the standard deviation.
4038
/// - parameter composition: The composition of the collection.
4139
/// - returns: The standard deviation of the collection, rounded to a representable value.
42-
///
43-
/// The time complexity of this method is O(n).
4440
@inlinable
4541
func standardDeviation<T: ConvertibleToReal>(
4642
variable: KeyPath<Element, T>,
@@ -57,7 +53,6 @@ public extension Collection {
5753
///
5854
/// Since there is no notion of covariance in collections with less than two elements,
5955
/// this method returns NaN if the array count is less than two.
60-
/// The time complexity of this method is O(n).
6156
@inlinable
6257
func covariance<T, U>(
6358
of X: KeyPath<Element, T>,

Sources/StatKit/Descriptive Statistics/Distribution/Continuous/GammaDistribution.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public struct GammaDistribution: ContinuousDistribution, UnivariateDistribution
1414
/// Creates a Gamma Distribution with a specified alpha and beta parameters.
1515
/// - parameter alpha: The distribution alpha parameter.
1616
/// - parameter beta: The distribution beta parameter.
17+
///
18+
/// - important: This initializer is deprecated. Use ``init(shape:scale:)`` or ``init(shape:rate:)`` instead.
1719
@available(*, deprecated, renamed: "init(shape:scale:)")
1820
public init(alpha: Double, beta: Double) {
1921
precondition(0 < alpha, "The shape parameter needs to be greater than 0.")

Sources/StatKit/Descriptive Statistics/Distribution/Continuous/NormalDistribution.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ public struct NormalDistribution: ContinuousDistribution, UnivariateDistribution
1818
self.variance = variance
1919
}
2020

21+
/// Create a Normal Distribution with a specified mean and standard deviation.
22+
/// - parameter mean: The mean value of this distribution.
23+
/// - parameter standardDeviation: The standard deviation for this distribution.
2124
public init(mean: Double, standardDeviation: Double) {
2225
precondition(
2326
0 < standardDeviation,

Sources/StatKit/Descriptive Statistics/Ranking/Ranking.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ public extension Collection {
99
/// - important: This method triggers a precondition failure if attempting to rank a collection
1010
/// of instances that do not compare equal to themselves. For example, attempting to rank a collection
1111
/// of floating point numbers that contain NaN's will fail, since `Double.nan == Double.nan` is false.
12-
///
13-
/// The time complexity of this method is O(n).
1412
func rank<T: Comparable & Hashable>(
1513
variable: KeyPath<Element, T>,
1614
by order: @escaping (_ lhs: T, _ rhs: T) -> Bool,

0 commit comments

Comments
 (0)