-
-
Notifications
You must be signed in to change notification settings - Fork 0
Statistical.NormDist
Calculates the value of the Normal distribution (also known as Gaussian distribution) for a given input x. It supports both the probability density function (PDF) and the cumulative distribution function (CDF), depending on the cumulative parameter.
Statistical.NormDist(
x as number,
optional mean as number,
optional std as number,
optional accumulative as logical
) as number-
x: The value for which the normal distribution will be evaluated. -
mean(optional): The mean ($\mu$ ) of the distribution. Defaults to 0 if not provided. -
standard deviation(optional): The standard deviation ($\sigma$ ) of the distribution. Defaults to 1 if not provided. -
cumulative(optional): Logical value indicating whether to return the cumulative distribution (true) or the probability density (false). Defaults to true.
- When
cumulative = false, the function returns the probability density at point x using the formula:$\varphi(z)=\frac{1}{\sqrt{2\pi}} \exp(-\frac{z^2}{2})β$ - where
$z = \frac{x-\mu}{\sigma}$ is the number of standard deviations from mean.
- When
cumulative = true, the function returns the cumulative probability up to point$x$ using the formula:-
$\phi(z)=\frac{1}{2} + \frac{1}{\sqrt{2 \pi}} \int_{0}^{z}{e^{-t^{2}/2}dt}$ .
-
- The integral part is calculated by Gaussian Quadrature, which uses a 24-point Legendre-Gauss approximation for high accuracy.
$\frac{1}{\sqrt{2\pi}} \int_{0}^{z}{e^{-t^{2}/2}dt} = \frac{z}{4} \sqrt{\frac{2}{\pi}} \sum_{i=1}^{24}{w_{i} \exp(-\frac{z^{2}(t_{i}+1)^2}{8})}$ - where
$w_{i}$ and$t_{i}$ are parameters provided by a Gaussian Quadrature table for 24-point approximation
- This function is useful for statistical modeling, hypothesis testing, and data normalization.
Returns the normal cumulative probability up to a given cumulative = false, returns the normal probability density at point cumulative is false.
Example 1: Calculating the cumulative probability for a value of
Statistical.NormDist(100, 80, 10)Result
0.97724986805182079Example 2: Calculating the normal PDF for given mean and standard deviation.
Statistical.NormDist(100, 80, 10, false)Result
0.0539909665131881Example 3: In order to calculate the standard normal CDF, just don't input any mean nor standard deviation.
Statistical.NormDist(1.96)Result
0.97500210485177974Example 4: Calculating the standard normal PDF.
Statistical.NormDist(1.96, null, null, false)Result
0.058440944333451476-
Gaussian Quadrature Weights and Abscissae
- Author: Mike "Pomax" Kamermans
- Published at: June 5th, 2011
- Binary.Unzip πβοΈ
- DateTime.ToUnixTime πβοΈ
- Decision.EntropyWeights πβοΈ
- Decision.TOPSIS πβοΈ
- List.Correlation πβοΈ
- List.Intercept πβοΈ
- List.Outliers πβοΈ
- List.PopulationStdDev πβοΈ
- List.Primes πβοΈ
- List.Rank πβοΈ
- List.Slope πβοΈ
- List.Variance πβοΈ
- List.WeightedAverage πβοΈ
- Number.FromRoman πβοΈ
- Number.IsInteger πβοΈ
- Number.IsPrime πβοΈ
- Number.ToRoman πβοΈ
- Statistical.NormDist πβοΈ
- Statistical.NormInv πβοΈ
- Table.AddColumnFromList πβοΈ
- Table.CorrelationMatrix πβοΈ
- Table.NormalizeColumnNames πβοΈ
- Table.NormalizeTextColumns πβοΈ
- Table.RemoveBlankColumns πβοΈ
- Table.TransposeCorrectly πβοΈ
- Text.CountChar πβοΈ
- Text.ExtractNumbers πβοΈ
- Text.HtmlToPlainText πβοΈ
- Text.RegexExtract πβοΈ
- Text.RegexReplace πβοΈ
- Text.RegexSplit πβοΈ
- Text.RegexTest πβοΈ
- Text.RemoveAccents πβοΈ
- Text.RemoveDoubleSpaces πβοΈ
- Text.RemoveLetters πβοΈ
- Text.RemoveNumerals πβοΈ
- Text.RemovePunctuations πβοΈ
- Text.RemoveStopwords πβοΈ
- Text.RemoveWeirdChars πβοΈ
- AreArraysEquals πβοΈ
- AutoFillFormulas πβοΈ
- CleanString πβοΈ
- DisableRefreshAll πβοΈ
- EnableRefreshAll πβοΈ
- FileExists πβοΈ
- FileNameIsValid πβοΈ
- GetAllFileNames πβοΈ
- GetLetters πβοΈ
- GetMonthNumberFromName πβοΈ
- GetStringBetween πβοΈ
- GetStringWithSubstringInArray πβοΈ
- GetTableColumnNames πβοΈ
- IsAllTrue πβοΈ
- IsInArray πβοΈ
- ListObjectExists πβοΈ
- PreviousMonthNumber πβοΈ
- RangeHasAnyFormula πβοΈ
- RangeHasConstantValues πβοΈ
- RangeIsHidden πβοΈ
- RangeToHtml πβοΈ
- SendEmail πβοΈ
- SetQueryFormula πβοΈ
- StringContains πβοΈ
- StringEndsWith πβοΈ
- StringStartsWith πβοΈ
- SubstringIsInArray πβοΈ
- Summation πβοΈ
- TableHasQuery πβοΈ
- WorksheetHasListObject πβοΈ