<jupyter_start><jupyter_text>Setup some test data to useThis is from a Poisson dist with mean 50<jupyter_code>np.random.seed(8675309)
test_data_dist = pymc.Poisson('Test_Data', mu=50)

test_data = [test_data_dist.random() for v in range(10000)]
# print(d_tmp)
plt.hist(test_data, 10)

rate = pymc.Uniform('mean', lower=0, upper=1000)
data = pymc.Poisson('Data', mu=rate, observed=True, value=test_data[::100])

model = pymc.MCMC((rate, data))

model.sample(iter=10000, burn=1000, verbose=0, progress_bar=1, burn_till_tuned=True, thin=10)



pprint(model.stats())
pymc.Matplot.plot(model)

ans = []

for n_iter in tb.logspace(1e1, 1e6, 10):
    print('%%%%%%%', n_iter)
    del model
    model = pymc.MCMC((rate, data))
    model.sample(iter=10000, burn=1000, verbose=0, thin=10, progress_bar=1, burn_till_tuned=True)
    ans.append((n_iter, model.stats()))
    
n_iter = [v[0] for v in ans]
plt_range = [v[1]['mean']['95% HPD interval'] for v in ans]
plt.figure()
plt.loglog(n_iter, plt_range)
plt.ylim((4e1, 6e1))
plt.loglog(n_iter, [v[1]['mean']['mean'] for v in ans], label='mean')
plt.legend()
# plt.gca().locator_params(axis='y',nbins=10)
plt.yscale('linear')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18090452261306533, 'fraction_numerical': 0.05778894472361809, 'mean_word_length': 6.113095238095238, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '477375', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 549, 'n_tokens_neox': 494, 'n_words': 97, 'path': 'Counting/Counting1.ipynb', 'repo_name': 'balarsen/pymc_learning', 'size': '1194'}