Documentation Index Fetch the complete documentation index at: https://docsa.stemfard.com/llms.txt
Use this file to discover all available pages before exploring further.
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:
A = [[4, 7, 2, 1],
[8, 3, 6, 5],
[9, 0, 4, 3]]
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
The input matrix, expressed as an array of row arrays.
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.
Name assigned to the computed result in the response.
Response verbosity: "lite", "standard", or "detailed".
Include background theory alongside solution steps.
Format for step content: "html", "latex", or "speech".
decimals
integer | null
default: "null"
Decimal precision for rounding the result. Pass null for full precision.
Apply decimals rounding to intermediate step values.
Include normalized request parameters in the response.
Include curated learning resource links in the response.
Include links to related Stemfard endpoints in the response.
Include a description of the result object’s properties.
Example — compute all statistics
curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]],
"type": "all",
"result_name": "stats",
"api_level": "standard",
"decimals": 4
}'
{
"stats" : {
"row_min" : [ 1 , 3 , 0 ],
"col_min" : [ 4 , 0 , 2 , 1 ],
"mat_min" : 0 ,
"row_max" : [ 7 , 8 , 9 ],
"col_max" : [ 9 , 7 , 6 , 5 ],
"mat_max" : 9 ,
"row_sum" : [ 14 , 22 , 16 ],
"col_sum" : [ 21 , 10 , 12 , 9 ],
"mat_sum" : 52 ,
"row_mean" : [ 3.5 , 5.5 , 4.0 ],
"col_mean" : [ 7.0 , 3.3333 , 4.0 , 3.0 ],
"mat_mean" : 4.3333 ,
"row_median" : [ 3.0 , 5.5 , 3.5 ],
"col_median" : [ 8.0 , 3.0 , 4.0 , 3.0 ],
"mat_median" : 4.0 ,
"row_var" : [ 5.25 , 3.6875 , 10.6875 ],
"col_var" : [ 4.6667 , 8.6667 , 2.6667 , 2.6667 ],
"mat_var" : 6.8056 ,
"row_std" : [ 2.2913 , 1.9209 , 3.2692 ],
"col_std" : [ 2.1602 , 2.9439 , 1.6330 , 1.6330 ],
"mat_std" : 2.6087
}
}
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
POST .../row-min — minimum of each row
Returns an array containing the minimum value from each row of a. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-minName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-min \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]],
"result_name": "row_minimums",
"api_level": "lite"
}'
{
"row_minimums" : [ 1 , 3 , 0 ]
}
POST .../col-min — minimum of each column
Returns an array containing the minimum value from each column of a. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-minName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-min \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]],
"result_name": "col_minimums",
"api_level": "lite"
}'
{
"col_minimums" : [ 4 , 0 , 2 , 1 ]
}
POST .../mat-min — minimum of the entire matrix
Returns the single smallest value across all elements of a. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-minName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-min \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "minimum", "api_level": "lite"}'
POST .../row-max — maximum of each row
Returns an array containing the maximum value from each row of a. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-maxName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-max \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "row_maximums", "api_level": "lite"}'
{
"row_maximums" : [ 7 , 8 , 9 ]
}
POST .../col-max — maximum of each column
Returns an array containing the maximum value from each column of a. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-maxName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-max \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "col_maximums", "api_level": "lite"}'
{
"col_maximums" : [ 9 , 7 , 6 , 5 ]
}
POST .../mat-max — maximum of the entire matrix
Returns the single largest value across all elements of a. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-maxName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-max \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "maximum", "api_level": "lite"}'
Sum and mean
POST .../row-sum — sum of each row
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-sumName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-sum \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]],
"result_name": "row_totals",
"api_level": "standard"
}'
{
"row_totals" : [ 14 , 22 , 16 ]
}
POST .../col-sum — sum of each column
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-sumName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-sum \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "col_totals", "api_level": "lite"}'
{
"col_totals" : [ 21 , 10 , 12 , 9 ]
}
POST .../mat-sum — sum of all elements
Returns the sum of every element in the matrix. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-sumName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-sum \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "total", "api_level": "lite"}'
POST .../row-mean — mean of each row
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-meanName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-mean \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "row_means", "api_level": "lite", "decimals": 4}'
{
"row_means" : [ 3.5 , 5.5 , 4.0 ]
}
POST .../col-mean — mean of each column
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-meanName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-mean \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "col_means", "api_level": "lite", "decimals": 4}'
{
"col_means" : [ 7.0 , 3.3333 , 4.0 , 3.0 ]
}
POST .../mat-mean — mean of all elements
Returns the arithmetic mean of all elements in the matrix. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-meanName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-mean \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "mean", "api_level": "lite", "decimals": 4}'
POST .../row-median — median of each row
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-medianName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-median \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]],
"result_name": "row_medians",
"api_level": "standard",
"decimals": 2
}'
{
"row_medians" : [ 3.0 , 5.5 , 3.5 ]
}
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.
POST .../col-median — median of each column
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-medianName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-median \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "col_medians", "api_level": "lite"}'
{
"col_medians" : [ 8.0 , 3.0 , 4.0 , 3.0 ]
}
POST .../mat-median — median of all elements
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-medianName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-median \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "median", "api_level": "lite"}'
Variance and standard deviation
POST .../row-var — variance of each row
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-varName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-var \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]],
"result_name": "row_variances",
"api_level": "standard",
"decimals": 4
}'
{
"row_variances" : [ 5.25 , 3.6875 , 10.6875 ]
}
POST .../col-var — variance of each column
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-varName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-var \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "col_variances", "api_level": "lite", "decimals": 4}'
{
"col_variances" : [ 4.6667 , 8.6667 , 2.6667 , 2.6667 ]
}
POST .../mat-var — variance of all elements
Returns the variance computed across every element in the matrix. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-varName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-var \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "variance", "api_level": "lite", "decimals": 4}'
POST .../row-std — standard deviation of each row
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-stdName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/row-std \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]],
"result_name": "row_std_devs",
"api_level": "standard",
"decimals": 4
}'
{
"row_std_devs" : [ 2.2913 , 1.9209 , 3.2692 ]
}
POST .../col-std — standard deviation of each column
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-stdName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/col-std \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "col_std_devs", "api_level": "lite", "decimals": 4}'
{
"col_std_devs" : [ 2.1602 , 2.9439 , 1.6330 , 1.6330 ]
}
POST .../mat-std — standard deviation of all elements
Returns the standard deviation computed across every element in the matrix. POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-stdName for the result in the response.
Response verbosity: "lite", "standard", or "detailed".
decimals
integer | null
default: "null"
Decimal precision for rounding.
Example curl --request POST \
--url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-statistics/mat-std \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{"a": [[4, 7, 2, 1], [8, 3, 6, 5], [9, 0, 4, 3]], "result_name": "std_dev", "api_level": "lite", "decimals": 4}'