Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Libraries

    skidmarks 0.0.3

    Download button

    No screenshots available
    Downloads: 244  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    brentp | More programs
    MIT/X Consortium Lic... / FREE
    October 14th, 2009, 13:56 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    skidmarks description

    Find runs (non-randomness) in sequences

    skidmarks is a Python module that implements some functions to check a sequence for randomness. in some cases, it is assumed to be a binary sequence (not only 1's and 0's but containing only 2 distinct values). Any feedback or improvements are welcomed

     >>> from skidmarks import gap_test, wald_wolfowitz, auto_correlation, serial_test

    Wald-Wolfowitz

    http://en.wikipedia.org/wiki/Wald-Wolfowitz_runs_test

    http://support.sas.com/kb/33/092.html

     >>> r = wald_wolfowitz('1000001')
     >>> r['n_runs'] # should be 3, because 1, 0, 1
     3

     >>> r['p'] < 0.05 # not < 0.05 evidence to reject Ho of random sequence
     False


    # this should show significance for non-randomness

     >>> li = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
     >>> wald_wolfowitz(li)['p'] < 0.05
     True


    Autocorrelation

     >>> result = auto_correlation('00000001111111111100000000')
     >>> result['p'] < 0.05
     True

     >>> result['auto_correlation']
     0.83766233766233755


    Serial Test

    http://books.google.com/books?id=EIbxfCGfzgcC&lpg=PA141&ots=o-8ymmqbs9&pg=PA142#v=onepage&q=&f=false

     >>> serial_test('101010101111000')
     {'chi': 1.4285714285714286, 'p': 0.69885130769248427}

     >>> serial_test('110000000000000111111111111')
     {'chi': 18.615384615384617, 'p': 0.00032831021826061683}


    Gap Test

    http://books.google.com/books?id=EIbxfCGfzgcC&lpg=PA141&ots=o-8ymmqbs9&pg=PA142#v=onepage&q=&f=false

     >>> gap_test('100020001200000')
     {'chi': 756406.99909855379, 'item': '1', 'p': 0.0}

     >>> gap_test('101010111101000')
     {'chi': 11.684911193438811, 'item': '1', 'p': 0.23166089118674466}


    gap_test() will default to looking for gaps between the first value in the sequence (in this case '1') and each later occurrence. use the item kwarg to specify another value.

     >>> gap_test('101010111101000', item='0')
     {'chi': 11.028667632612191, 'item': '0', 'p': 0.27374903509732523}



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    skid marks | sequence runs | Python library | runs | sequence | finder



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM