module Bottle::Statistics
Extended Modules
Direct including types
Defined in:
arrayops/statistics.crInstance Method Summary
- #all(a : BaseArray(U), axis : Int32) forall U
- #all(a : BaseArray(U)) forall U
- #any(a : BaseArray(U), axis : Int32) forall U
- #any(a : BaseArray)
- #clip(a : BaseArray(U), min : Number, max : Number) forall U
- #max(a : BaseArray, axis : Int32)
-
#max(a : BaseArray(U)) forall U
Computes the maximum value of a BaseArray
- #mean(a : BaseArray, axis : Int32)
-
#mean(a : BaseArray)
Computes the average of all BaseArray values
- #min(a : BaseArray, axis : Int32)
-
#min(a : BaseArray(U)) forall U
Computes the minimum value of a BaseArray
- #ptp(a : BaseArray, axis : Int32)
-
#ptp(v : BaseArray)
Computes the "peak to peak" of a BaseArray (max - min)
-
#std(a : BaseArray)
Computes the standard deviation of a BaseArray
- #sum(a : BaseArray, axis : Int32)
-
#sum(a : BaseArray(U)) forall U
Computes the total sum of a BaseArray
Instance Method Detail
Computes the maximum value of a BaseArray
v = BaseArray.new [1, 2, 3, 4]
max(v) # => 4
Computes the average of all BaseArray values
v = BaseArray.new [1, 2, 3, 4]
mean(v) # => 2.5
Computes the minimum value of a BaseArray
v = BaseArray.new [1, 2, 3, 4]
min(v) # => 1
Computes the "peak to peak" of a BaseArray (max - min)
v = BaseArray.new [1, 2, 3, 4]
v.ptp # => 3
Computes the standard deviation of a BaseArray
v = BaseArray.new [1, 2, 3, 4]
std(v) # => 1.118
Computes the total sum of a BaseArray
v = BaseArray.new [1, 2, 3, 4]
sum(v) # => 10