# Lilliefors test

• Mar 17th 2010, 01:39 PM
Krahl
Lilliefors test
Hi;

I came across the table for use with the specialised K-S test and it said that the critical values were calculated using monte carlo calculations using 1000 or more samples for each value of N (sample size). I'm trying to understand how this was done. can anyone help me understand this. This is what i think;

Let the Lilliefors test statistic be $\displaystyle D=max_{y \in R}|F(y)-S_{0}(y)|$ and $\displaystyle D^{*}=max_{x \in [0,1]}|F^{*}(x)-x|$ where $\displaystyle S_{0}$ is the cumulative normal distr. function, F is the empirical c.d.f for the sample $\displaystyle y_1,...,y_n$ , $\displaystyle F^*$ is the e.c.d.f of the sample $\displaystyle x_1,...,x_n$ with $\displaystyle x_i=S_{0}(y_i)$.

to simulate the null distribution of the lilliefors test statistic (D) i need to;

1) generate a sample of size n from the standard normal distribution N(0,1)

2) for the sample calculate $\displaystyle D^*$

3)Do 1) and 2) 1,000 times

4)the distribution of the N values $\displaystyle D^*$ then approximates the null distribution of D

But were do i go on from here to calculate the right tail of this null distribution?
• Mar 17th 2010, 02:47 PM
Funnily enough I co-authored a paper on this last summer...

What we did is took the 1000 values (in our case though we used many millions) and ordered them, smallest to largest. Then you just take the value which corresponds to the percentage point you want.

So for your 1000 values, if you want the upper 5% point, take the 950th values in your ordered set (have to check if we used 950, 951 or a combo of both).
• Mar 17th 2010, 05:18 PM
Krahl
Hi