MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: KS Analysis In Mathematica

  • To: mathgroup at
  • Subject: [mg49290] Re: [mg49286] KS Analysis In Mathematica
  • From: "Christos Argyropoulos MD" <chrisarg at>
  • Date: Mon, 12 Jul 2004 02:11:31 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Try the following url
if you are after for a "Normality" test and other goodies.
Alternatively try the following Mathematica Code:
Q[s_] := Module[{r}, Sum[(r - s)^r*(x^r)/r!, {r, 0, Floor[s]}]]
F[s_, m_] := Normal[Series[Simplify[(Q[s]^2)/Q[2*s]], {x, 0, m}]]
Kolmogorov[d_, m_] := Min[N[Abs[Coefficient[F[m*d, m], x, m]*m!/
(m^m)]], 1]
Lillefors[y_List] := Module[{stand, quant,
       kolm}, stand = Standardize[y]; quant = Transpose[QuantileForm
    kolm = N[Max[Abs[quant[[1]] -
 Map[CDF[NormalDistribution[0, 1], #] &, quant[[2]]]]]]]
Kolmogorov[d,m] gives the Probability of the Kolmogorov Smirnov Test 
when the test statistic value is d and the sample tested is of size m.
If you want to test whether a list of observations has come from a 
Normal Distribution with unknow mean and variance, use the function 
Lillefors[obs] which calculates the P-value based on the Lillefors 
modification of the KS statistic.
Christos Argyropoulos

Sent by Medscape Mail: Free Portable E-mail for Professionals on the Move

  • Prev by Date: Re: what kind of a programming language is Mathematica?
  • Next by Date: Re: ArcCos[x] with x > 1
  • Previous by thread: KS Analysis In Mathematica
  • Next by thread: Re: KS Analysis In Mathematica