normcdf(x: number,mu?: number,sigma?: number,): number
Computes the cumulative distribution function (CDF) of a normal distribution.
Calculates the probability that a normally distributed random variable with mean mu and standard deviation sigma is less than or equal to x.
If mu and sigma are not provided, it defaults to the standard normal distribution (mu = 0, sigma = 1).
Compute standard normal CDF at x = 2
Compute standard normal CDF at x = 2
import { assertEquals } from "jsr:@std/assert"; assertEquals(normcdf(2), 0.9772498701098755);
Compute normal CDF with custom mean and standard deviation
Compute normal CDF with custom mean and standard deviation
import { assertEquals } from "jsr:@std/assert"; assertEquals(normcdf(0, 1, 2), 0.30853751691860176);
Compute normal CDF at the mean (should be close to 0.5)
Compute normal CDF at the mean (should be close to 0.5)
import { assertEquals } from "jsr:@std/assert"; assertEquals(normcdf(10, 10, 3), 0.5);