simple-squiggle/node_modules/mathjs/docs/reference/functions/mad.md

914 B

Function mad

Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.

Syntax

math.mad(a, b, c, ...)
math.mad(A)

Parameters

Parameter Type Description
array Array | Matrix A single matrix or multiple scalar values.

Returns

Type Description
  • | The median absolute deviation.

Throws

Type Description

Examples

math.mad(10, 20, 30)             // returns 10
math.mad([1, 2, 3])              // returns 1
math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5

See also

median, mean, std, abs