Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.To browse the .NET Framework source code for this type, see the Reference Source.
VBMath
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| SafeNegLog10 | 1 | 安全的 -log10(p) 计算, 处理p=0的边界情况 |
| Clip | 1 | Standard clamping of a value into a fixed range |
| Clamp | 1 | 返回范围内的一个数值。可以使用 clamp 函数将不断增加、减小或随机变化的数值限制在一系列的值中。 |
| LeastCommonMultiple | 1 | Function to calculate the Least Common Multiple (LCM) |
| EuclidGcd | 1 | Method which computes GCD of two numbers using Euclid's algorithm. |
| SteinGcd | 1 | Method which computes GCD of two numbers using Stein's algorithm. |
| Factorial | 1 | 阶乘 |
| Covariance | 1 | Returns the covariance of two data vectors. |
| WeighedAverage | 1 | 请注意,data的元素数量必须要和weights的长度相等 |
| WeightedMedian | 1 | 计算加权中位数 |
| WeightedMedianOptimized | 1 | 更高效的加权中位数计算(使用Value-Weight对结构) |
| seq | 2 | |
| LogN | 1 | 以 N 为底的对数 LogN(X) = Log(X) / Log(N) |
| Max | 2 | return the maximum of a, b and c |
| Hypot | 1 | sqrt(a^2 + b^2) without under/overflow. |
| Pow2 | 1 | Calculates power of 2. |
| Log2 | 1 | Get base of binary logarithm. |
| IsPowerOf2 | 1 | Checks if the specified integer is power of 2. |
| Sum | 5 | Logical true values are regarded as one, false values as zero. |
| ProductALL | 3 | 计算出所有的数的乘积 |
| SD | 4 | Standard Deviation In statistics, the standard deviation (SD, also represented by the Greek letter sigma σ or the Latin letter s) is a measure that is used to quantify the amo… |
| RMS | 1 | Root mean square. |
| RSD | 2 | |
| PoissonPDF | 1 | Returns the PDF value at x for the specified Poisson distribution. |
| ClipUpper | 1 | |
| Permut | 1 | |
| CumSum | 1 | |
| FactorialSequence | 1 | |
| RangesAt | 1 | |
| RMSE | 1 |
03 Members
Double)安全的 -log10(p) 计算, 处理p=0的边界情况
Double, Double)Standard clamping of a value into a fixed range
Single, Single, Single)返回范围内的一个数值。可以使用 clamp 函数将不断增加、减小或随机变化的数值限制在一系列的值中。
最小数值和最大数值指定返回值的范围。 参数是值要钳制在范围内的属性或变量。 如果参数位于最小数值和最大数值之间的数值范围内,则该函数将返回参数值。 如果参数大于范围,该函数将返回最大数值。 如果参数小于范围,该函数将返回最小数值。
| Name | Type | Description |
|---|---|---|
x | Single | - |
min | Single | - |
max | Single | - |
Int32, Int32)Function to calculate the Least Common Multiple (LCM)
计算最小公倍数
| Name | Type | Description |
|---|---|---|
a | Int32 | - |
b | Int32 | - |
Int32, Int32)Method which computes GCD of two numbers using Euclid's algorithm.
计算最大公约数
| Name | Type | Description |
|---|---|---|
a | Int32 | First number. |
b | Int32 | Second number. |
GCD of source numbers.
Int32, Int32)Method which computes GCD of two numbers using Stein's algorithm.
计算最大公约数
| Name | Type | Description |
|---|---|---|
a | Int32 | First number. |
b | Int32 | Second number. |
GCD of source numbers.
Int32)阶乘
| Name | Type | Description |
|---|---|---|
a | Int32 | - |
Double(), Double())Returns the covariance of two data vectors.
| Name | Type | Description |
|---|---|---|
a | Double() | double[] of data |
b | Double() | double[] of data @return the covariance of a and b, cov(a,b) |
IEnumerable(Of Double), Double())请注意,data的元素数量必须要和weights的长度相等
| Name | Type | Description |
|---|---|---|
data | IEnumerable(Of Double) | - |
weights | Double() | 这个数组里面的值的和必须要等于1 |
Double(), Double())计算加权中位数
| Name | Type | Description |
|---|---|---|
values | Double() | 数据值数组 |
weights | Double() | 对应的权重数组 |
加权中位数
Double(), Double())更高效的加权中位数计算(使用Value-Weight对结构)
[Sequence Generation] Generate regular sequences. seq is a standard generic with a default method.
| Name | Type | Description |
|---|---|---|
From | Value(Of Double) | the starting and (maximal) end values of the sequence. Of length 1 unless just from is supplied as an unnamed argument. |
To | Double | the starting and (maximal) end values of the sequence. Of length 1 unless just from is supplied as an unnamed argument. |
By | Double | number: increment of the sequence |
Double, Double)以 N 为底的对数 LogN(X) = Log(X) / Log(N)
| Name | Type | Description |
|---|---|---|
x | Double | - |
N | Double | - |
Int32, Int32, Int32)return the maximum of a, b and c
| Name | Type | Description |
|---|---|---|
a | Int32 | - |
b | Int32 | - |
c | Int32 | @return |
Double, Double, Double)return the maximum of a, b and c
| Name | Type | Description |
|---|---|---|
a | Double | - |
b | Double | - |
c | Double | @return |
Double, Double)sqrt(a^2 + b^2) without under/overflow.
| Name | Type | Description |
|---|---|---|
a | Double | - |
b | Double | - |
Int32)Calculates power of 2.
| Name | Type | Description |
|---|---|---|
power | Int32 | Power to raise in. |
Returns specified power of 2 in the case if power is in the range of [0, 30]. Otherwise returns 0.
Int32)Get base of binary logarithm.
| Name | Type | Description |
|---|---|---|
x | Int32 | Source integer number. |
Power of the number (base of binary logarithm).
Int32)Checks if the specified integer is power of 2.
| Name | Type | Description |
|---|---|---|
x | Int32 | Integer number to check. |
Returns true if the specified number is power of 2. Otherwise returns false.
IEnumerable(Of Boolean))Logical true values are regarded as one, false values as zero. For historical reasons, NULL is accepted and treated as if it were integer(0).
| Name | Type | Description |
|---|---|---|
bc | IEnumerable(Of Boolean) | - |
ValueTuple(Of Double, Double))Sum all tuple members
| Name | Type | Description |
|---|---|---|
t | ValueTuple(Of Double, Double) | - |
ValueTuple(Of Double, Double, Double))Sum all tuple members
| Name | Type | Description |
|---|---|---|
t | ValueTuple(Of Double, Double, Double) | - |
ValueTuple(Of Double, Double, Double, Double))Sum all tuple members
| Name | Type | Description |
|---|---|---|
t | ValueTuple(Of Double, Double, Double, Double) | - |
ValueTuple(Of Double, Double, Double, Double, Double))Sum all tuple members
| Name | Type | Description |
|---|---|---|
t | ValueTuple(Of Double, Double, Double, Double, Double) | - |
IEnumerable(Of Double))计算出所有的数的乘积
| Name | Type | Description |
|---|---|---|
[in] | IEnumerable(Of Double) | - |
IEnumerable(Of Int32))计算出所有的数的乘积
| Name | Type | Description |
|---|---|---|
[in] | IEnumerable(Of Int32) | - |
IEnumerable(Of Int64))计算出所有的数的乘积
| Name | Type | Description |
|---|---|---|
[in] | IEnumerable(Of Int64) | - |
IEnumerable(Of Double), Boolean)Standard Deviation
In statistics, the standard deviation (SD, also represented by the Greek letter sigma σ or the Latin letter s) is a measure that is used to quantify the amount of variation or dispersion of a set of data values. A low standard deviation indicates that the data points tend to be close to the mean (also called the expected value) of the set, while a high standard deviation indicates that the data points are spread out over a wider range of values.
计算标准差 (样本标准差, ddof=1)
StdDev
IEnumerable(Of Int32))Standard Deviation
IEnumerable(Of Int64))Standard Deviation
IEnumerable(Of Single))Standard Deviation
IEnumerable(Of Double))Root mean square.
(均方根)
IEnumerable(Of Double))relative standard deviation
Relative standard deviation is a common formula used in statistics and probability theory to determine a standardized measure of the ratio of the standard deviation to the mean. This formula is useful in various situations including when comparing your own data to other related data and in financial settings such as the stock market.
Relative standard deviation, which also may be referred to as RSD or the coefficient of variation, is used to determine if the standard deviation of a set of data is small or large when compared to the mean. In other words, the relative standard deviation can tell you how precise the average of your results is. This formula is most frequently used in chemistry, statistics and other math-related settings but can also be used in the business world when assessing finances and the stock market.
The relative standard deviation Of a Set Of data can be depicted As either a percentage Or As a number. The higher the relative standard deviation, the more spread out the results are from the mean Of the data. On the other hand, a lower relative standard deviation means that the measurement Of data Is more precise.
(相对标准偏差(RSD)= 标准偏差(SD)/ 计算结果的算术平均值(X)* 100%)
RSD is also an alias of CV%
| Name | Type | Description |
|---|---|---|
data | IEnumerable(Of Double) | - |
Int32, Double)Returns the PDF value at x for the specified Poisson distribution.
IEnumerable(Of Double), Double)Int32, Int32)IEnumerable(Of Double))Int32)Double)Double, Double, Double)Double(), Double())IEnumerable(Of Double), Int32)