<jupyter_start><jupyter_text>An early result in the study of human dynamic systems is the claim that response times to email follow a power law distribution (http://cds.cern.ch/record/613536/). This result has been built on by others (http://www.uvm.edu/~pdodds/files/papers/others/2004/johansen2004.pdf, http://dx.doi.org/10.1103/physreve.83.056101). However, Clauset, Shalizi, and Newman (citation needed) have challenged the pervasive use discovery of powerlaws, claiming that these studies often depend on unsound statistics.Here we apply the method of power law distribution fitting and testing to the email response times of several public mailing lists.<jupyter_code>from bigbang.archive import Archive
import pandas as pd

arx = Archive("ipython-dev",archive_dir="../archives")
print(arx.data.shape)
arx.data.drop_duplicates(subset=('From','Date'),inplace=True)<jupyter_output><empty_output><jupyter_text>We will look at messages in our archive that are responses to other messages and how long after the original email the response was made.<jupyter_code>response_times = []
response_times = []
for x in list(arx.data.iterrows()):
    if x[1]['In-Reply-To'] is not None:
        try:
            d1 = arx.data.loc[x[1]['In-Reply-To']]['Date']
            
            if isinstance(d1,pd.Series):
                d1 = d1[0]
            
            d2 = x[1]['Date']
            
            rt = (d2 - d1)
            
            response_times.append(rt.total_seconds())
        
        except AttributeError as e:
            print(e)
        except TypeError as e:
            print(e)
        except KeyError as e:
            # print e -- suppress error
            pass
len(response_times)
import matplotlib.pyplot as plt
%matplotlib inline
plt.semilogy(sorted(response_times,reverse=True))
import powerlaw

f = powerlaw.Fit(response_times)
print(f.power_law.alpha)
print(f.xmin)
print(f.D)
R, p = f.distribution_compare('power_law', 'lognormal')
print(R,p)<jupyter_output>1.74259853197
27753.0
0.018193948838
-5.13102609753 0.0552301041786
{'fraction_non_alphanumeric': 0.10398445092322643, 'fraction_numerical': 0.04664723032069971, 'mean_word_length': 3.236625514403292, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '352060', 'license': 'MIT', 'n_tokens_mistral': 708, 'n_tokens_neox': 636, 'n_words': 180, 'path': 'examples/experimental_notebooks/Testing Power Law Response Time Hypothesis.ipynb', 'repo_name': 'nllz/bigbang', 'size': '2058'}