#### 4.29 sddsdistest

• description: sddsdistest performs the Kolmogorov-Smirnov (K-S) test on a set of numbers to determine how likely those numbers are to have been drawn from a specified statistical distribution (e.g., gaussian, poisson).
• example: Try the K-S test on random numbers generated by sddsprocess

sddssequence -pipe=out -define=i,type=long -sequence=begin=0,end=9999,delta=1 | sddsprocess -pipe -define=column,gaussRN,grnd -define=column,uniformRN,rnd | sddsdistest -pipe -test=ks -gaussian -column=gaussRN -column=uniformRN | sddsprintout -pipe -column=ColumnName -column=distestSigLevel

The result is

ColumnName distestSigLevel ------------------------------------- gaussRN 4.019061e-01 uniformRN 1.598565e-32

which shows that the K-S test accurately distinguishes between numbers drawn from the two distributions. The probability that the numbers in column uniformRN are from a gaussian distribution is very small, whereas the probability that the numbers in column gaussRN are from a gaussian distribution is 40%.

• synopsis:

sddsdistest [input] [output] [-pipe=[in][,out]] -column=name[,sigma=name] ... -exclude=name[,name...] ... -gaussian | -poisson | -student | -chisquared [-degreesOfFreedom=value | @parameterName]

• switches:
• -pipe=[input][,output] — The standard SDDS Toolkit pipe option.
• -column=name[,sigma=name] — Specifies the name of a column to test, and optionally the name of the column with the measurement error for the each test value. name may contain wildcards. The sigma name may contain “%s”, for which each column name is substituted to obtain the corresponding sigma name. Multiple column options may be given.
• -exclude=name[,name...] — Specifies the names of columns to exclude from testing.
• -gaussian | -poisson | -student | -chisquared — Specifies the model distribution against which to test the data.
• -degreesOfFreedom=value | @parameterName — Specifies the number of degrees of freedoms to assume for the model distribution in the case of student and chi-squared distribution. The first form specifies a fixed value, whereas the second specifies taking the value for each page from the named parameter.
• author: M. Borland, ANL/APS.