sdevxn
The sdevxn function returns the standard deviation about a specified value for a general lua table that may contain non-numeric values, named keys, and sub-tables. This differs from the ordinary standard deviation which calculates the standard deviation about the mean value. Only numeric values found in the table are used in the calculation. See sdevn for calculation of the ordinary standard deviation of a table. The related sdev function calculates the mean of a 1-dimensional array, CImage, or list of numbers. Since an array is a specific type of table that contains only numbers or sub-tables, this function can also be used for arrays.
nStdDev = sdevxn( tbl, val )
tbl is a general lua table.
val is the target value about which the standad deviation is calculated.
nStdDev is the standard deviation of the values.
The following script returns the standard deviation of a table containing 1 million random numbers.
|
-- create a table of numbers |
|
-- ordinary standard devation about the mean |
|
-- standard deviation about the value 0.6 |
|
-- list the results |
The next example computes the standard deviation about 4of an ugly, complex table:
|
|
|
-- ordinary standard deviation |
|
-- standard deviation about the value 7 |
|
-- result: Sdev=6.97615, SD= |
Table and Array Functions, sdevn, meansdevn, sdev
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.