Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Conduct a cumulative sum-based randomness test that creates a test statistic from the maximum value that a cumulative sums random walk achieves
ResourceFunction["CUSUMMaxRandomnessTest"][sequence] conducts a cumulative sum-based randomness test on sequence. | |
ResourceFunction["CUSUMMaxRandomnessTest"][sequence,"properties"] conducts a cumulative sum-based randomness test on sequence and returns the associated property. |
"TestStatistic" | returns the test statistic |
"PValue" | returns the p-value associated with the test |
Generate a sequence of random integers:
In[1]:= | ![]() |
Visualize the sequence:
In[2]:= | ![]() |
Out[2]= | ![]() |
Apply a cumulative sums test:
In[3]:= | ![]() |
Out[3]= | ![]() |
In[4]:= | ![]() |
Out[4]= | ![]() |
Generate a sequence of integers from a random subsequence:
In[5]:= | ![]() |
In[6]:= | ![]() |
Visualize the sequence:
In[7]:= | ![]() |
Out[7]= | ![]() |
Apply a cumulative sums test. The small p-value indicates that the sequence is non-random and hence should be rejected:
In[8]:= | ![]() |
Out[8]= | ![]() |
In[9]:= | ![]() |
Out[9]= | ![]() |
Define and plot rule 30:
In[10]:= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
Test whether rule 30 is random:
In[12]:= | ![]() |
Out[12]= | ![]() |
CUSUMMaxRandomnessTest requires sequences of length 100 or more:
In[13]:= | ![]() |
Visualize the sampling distribution of the test statistic:
In[14]:= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License