Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.24 KB

std.md

File metadata and controls

65 lines (43 loc) · 1.24 KB

std

Compute the standard deviation of an array along an axis.

API

Numeric.stat.std(values, freedom = 0, invalid = false, level)

Measures the spread of the values around their mean.

  • Parameters:
    • values: Vector or matrix of input values
    • freedom: Degrees of freedom correction applied
    • invalid: When true skips NaN entries
    • level: Axis along which the deviation is computed
  • Returns: Standard deviation matching the requested axis
  • NumPy: Covers np.std, np.nanstd, ndarray.std through a single Numerix method.

Examples

Standard deviation of a vector

import Numeric from '@neabyte/numerix'

const value = Numeric.stat.std([1, 2, 3])

console.log(value)
// 0.816496580927726

Standard deviation with a degrees of freedom correction

import Numeric from '@neabyte/numerix'

const value = Numeric.stat.std([1, 2, 3], 1)

console.log(value)
// 1

Standard deviation of equal values

import Numeric from '@neabyte/numerix'

const value = Numeric.stat.std([4, 4, 4])

console.log(value)
// 0

Standard deviation of each matrix column

import Numeric from '@neabyte/numerix'

const values = Numeric.stat.std([[1, 2], [3, 4]], 0, false, 0)

console.log(values)
// [1,1]