Skip to main content
The matrix statistics endpoints let you compute descriptive statistics on a matrix — across individual rows, across individual columns, or over all elements at once. There are 21 endpoints in this group: a combined endpoint that accepts a type parameter to choose the specific statistic, and 20 individual endpoints organized by operation. All endpoints accept a single input matrix a and the full set of common request parameters. The sample matrix below is used throughout the examples on this page:

Combined endpoint

Use this endpoint to compute any statistic by setting the type field. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics

Parameters

number[][]
required
The input matrix, expressed as an array of row arrays.
string
required
The statistic to compute. Accepted values: "all", "row-min", "col-min", "mat-min", "row-max", "col-max", "mat-max", "row-sum", "col-sum", "mat-sum", "row-mean", "col-mean", "mat-mean", "row-median", "col-median", "mat-median", "row-var", "col-var", "mat-var", "row-std", "col-std", "mat-std".Pass "all" to compute and return every statistic in a single response.
string
default:"ans"
Name assigned to the computed result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
boolean
default:"true"
Include background theory alongside solution steps.
string[]
default:"[\"\"]"
Format for step content: "html", "latex", or "speech".
integer | null
default:"null"
Decimal precision for rounding the result. Pass null for full precision.
boolean
default:"false"
Apply decimals rounding to intermediate step values.
boolean
default:"true"
Include normalized request parameters in the response.
boolean
default:"true"
Include curated learning resource links in the response.
Include links to related Stemfard endpoints in the response.
boolean
default:"true"
Include a description of the result object’s properties.

Example — compute all statistics

200

Individual endpoints

The individual endpoints are grouped below by operation type. For all endpoints, a is the only operation-specific parameter; all other parameters are the common request parameters. The base path for all individual endpoints is: /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/

Min and max

Returns an array containing the minimum value from each row of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-min
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
200
Returns an array containing the minimum value from each column of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-min
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
200
Returns the single smallest value across all elements of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-min
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
Example
cURL
200
Returns an array containing the maximum value from each row of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-max
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
Example
cURL
200
Returns an array containing the maximum value from each column of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-max
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
Example
cURL
200
Returns the single largest value across all elements of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-max
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
Example
cURL
200

Sum and mean

Returns an array containing the sum of all elements in each row of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-sum
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
200
Returns an array containing the sum of all elements in each column of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-sum
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200
Returns the sum of every element in the matrix.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-sum
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
Example
cURL
200
Returns an array containing the arithmetic mean of the elements in each row of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-mean
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200
Returns an array containing the arithmetic mean of the elements in each column of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-mean
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200
Returns the arithmetic mean of all elements in the matrix.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-mean
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200

Median

Returns an array containing the median value of the elements in each row of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-median
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
200
For rows with an even number of elements, the median is the average of the two middle values after sorting. For the row [8, 3, 6, 5], the sorted order is [3, 5, 6, 8], so the median is (5 + 6) / 2 = 5.5.
Returns an array containing the median value of the elements in each column of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-median
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200
Returns the median value across all elements in the matrix, treating the entire matrix as a flat list of values.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-median
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200

Variance and standard deviation

Returns an array containing the variance of the elements in each row of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-var
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
200
Returns an array containing the variance of the elements in each column of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-var
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200
Returns the variance computed across every element in the matrix.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-var
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200
Returns an array containing the standard deviation of the elements in each row of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-std
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
200
Returns an array containing the standard deviation of the elements in each column of a.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-std
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200
Returns the standard deviation computed across every element in the matrix.POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-std
number[][]
required
The input matrix.
string
default:"ans"
Name for the result in the response.
string
default:"detailed"
Response verbosity: "lite", "standard", or "detailed".
integer | null
default:"null"
Decimal precision for rounding.
Example
cURL
200