Results 1 to 5 of 5

Math Help - Lilliefors test

  1. #1
    Member
    Joined
    Jul 2009
    Posts
    190
    Thanks
    3

    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 D=max_{y \in R}|F(y)-S_{0}(y)| and D^{*}=max_{x \in [0,1]}|F^{*}(x)-x| where S_{0} is the cumulative normal distr. function, F is the empirical c.d.f for the sample y_1,...,y_n , F^* is the e.c.d.f of the sample x_1,...,x_n with 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 D^*

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

    4)the distribution of the N values 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?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member Deadstar's Avatar
    Joined
    Oct 2007
    Posts
    722
    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).
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Jul 2009
    Posts
    190
    Thanks
    3
    Hi
    thanks for your reply

    oh i see. despite your few lines reply it helped alot.

    I can't sit down and do it 1,000 times in my life time lol so
    what i would like to do is use R to simulate the null distribution so that i can confirm the table. in the attachment i found the command for the null distribution for the k-s uniform case. I thought i could just change the uniform bit to normal but it doesn't work. I have never used R but it was the only one on my system. any ideas? any other program anyone knows how to do it in? thanks.
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member Deadstar's Avatar
    Joined
    Oct 2007
    Posts
    722
    Use Maple. That's what we used. It will handle 50-60 million runs for n=5.

    I'm looking through my code and trying to figure out how to help you but it's been a while since I had to do this and have forgotten most of the theory behind it...

    If you use Maple I can send you the code I used and you can look at it. It's all been compiled and it's quite difficult to make out what is going on though. It works well and is fast though.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Member
    Joined
    Jul 2009
    Posts
    190
    Thanks
    3
    Maple, yeah i like maple. If you could send the code so i could go through it that would be great. I hate R lol.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Looking for some statistical data for Lilliefors test
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: March 17th 2011, 09:58 AM
  2. Replies: 2
    Last Post: May 21st 2010, 09:56 AM
  3. Replies: 8
    Last Post: March 28th 2010, 05:45 PM
  4. Replies: 7
    Last Post: June 4th 2009, 09:33 PM
  5. ratio test (series) urgent test tommorow!
    Posted in the Calculus Forum
    Replies: 3
    Last Post: December 2nd 2008, 03:27 PM

Search Tags


/mathhelpforum @mathhelpforum