<jupyter_start><jupyter_text>Basic SIPmath Demo<jupyter_code>model = sm.sipmodel(10000, name='test_slurp', origin='<NAME> me', about='this is a test for sam')

input_1 = model.sipinput(distribution='normal', generator='hdr', name='normal distribution')
input_2 = model.sipinput(distribution='uniform', generator='rand', name='uniform distribution')

model.sample()

model.to_df().iloc[:5]
plt.hist(input_1, 100)
plt.show<jupyter_output><empty_output><jupyter_text>Arithmetic works!<jupyter_code>input_3 = model.sipinput(distribution='uniform')
model.sample()

plt.hist(input_2+input_3, 100)
plt.show()<jupyter_output><empty_output><jupyter_text>Lets time some sampling...<jupyter_code>model2 = sm.sipmodel(1000000)
input_21 = model2.sipinput(distribution='exponential')
input_22 = model2.sipinput(distribution='exponential')
input_23 = model2.sipinput(distribution='exponential')

start = time.time()
model2.sample()
end = time.time()
(end - start)<jupyter_output><empty_output><jupyter_text>300,000,000 individual samples in a small amount of time...<jupyter_code>start = time.time()
elementwise_sum = input_21+input_22+input_23
end = time.time()
(end - start)<jupyter_output><empty_output><jupyter_text>Math on samples pretty fast METALOG DISTRIBUTIONS - full functionality of RMetalog<jupyter_code>fish_data = np.loadtxt('sipmath/pymetalog/fishout.csv', delimiter=',', skiprows=1, dtype='str')[:,1].astype(np.float)

fish_metalog = pm.metalog(x=fish_data, bounds=[0,60], boundedness='b', step_len = 0.01, term_limit=9)

pm.plot(fish_metalog)
# quantile functions
pm.qmetalog(fish_metalog, y =[0.25,0.5,0.75], term = 9)
# percentile functions
pm.pmetalog(fish_metalog, q = [3, 10, 25], term = 9)
# density functions
pm.dmetalog(fish_metalog, q = [3, 10, 25], term = 9)<jupyter_output><empty_output><jupyter_text>Metalogs can be SIP distributions...<jupyter_code>model3 = sm.sipmodel(100000, name='test_for_sam')

fish_sip = model3.sipinput(distribution='metalog', metalog=fish_metalog, term=9)

model3.sample()

plt.hist(fish_sip, 100)
plt.show()<jupyter_output><class 'sipmath.pymetalog.metalog.metalog'><jupyter_text>Arithmetic can be performed on these sips just like any other...<jupyter_code>normal_sip = model3.sipinput(distribution='normal')
model3.sample()

plt.hist(normal_sip+fish_sip,100)
plt.show()
model3.to_xml('sam_test.xml')
#not yet working - xml to python translation
#model4 = sm.from_xml('path')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14875357580711074, 'fraction_numerical': 0.04127503064977524, 'mean_word_length': 8.34351145038168, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '15858', 'license': 'MIT', 'n_tokens_mistral': 1009, 'n_tokens_neox': 917, 'n_words': 152, 'path': 'demo-notebook.ipynb', 'repo_name': 'colsmit/sipmath', 'size': '2451'}