zscore(): array
Standardized Z score.
Calculates standardized z-scores by subtracting the mean and dividing by the standard deviation. Results have mean 0 and standard deviation 1.
Simple z-scores
Simple z-scores
import { assertEquals } from "jsr:@std/assert"; assertEquals(zscore([1, 2, 3, 4, 5]), [-1.2649110640673518, -0.6324555320336759, 0, 0.6324555320336759, 1.2649110640673518]);
x: array
Input array or matrix
Standardized z-score values
zscore(): matrix
Standardized Z score.
Calculates standardized z-scores by subtracting the mean and dividing by the standard deviation. Results have mean 0 and standard deviation 1.
Simple z-scores
Simple z-scores
import { assertEquals } from "jsr:@std/assert"; assertEquals(zscore([1, 2, 3, 4, 5]), [-1.2649110640673518, -0.6324555320336759, 0, 0.6324555320336759, 1.2649110640673518]);
x: matrix
Input array or matrix
Standardized z-score values