<jupyter_start><jupyter_text>Statistics ReviewFrom the pdf: https://risk-engineering.org/static/PDF/slides-stat-modelling.pdf<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
nobs = 100
X = np.linspace(0, 10, nobs)
obs = np.sin(X) + np.random.uniform(-0.1, 0.1, nobs)

plt.plot(obs)<jupyter_output><empty_output><jupyter_text>Probability mass function (PMF* For discrete data* Finds all the values that a random value might take Coin toss (two coins)<jupyter_code>n_tosses = 2
res = np.random.randint(0, 2, n_tosses)
print(res)

# If heads == 1 and tails == 0, get number of heads in sequence.
n_heads = res.sum()
print(f"Number of heads results for {n_tosses} tosses: {n_heads}")<jupyter_output>[0 1]
Number of heads results for 2 tosses: 1<jupyter_text>Larger scale<jupyter_code>n_epochs = 1000
heads = np.zeros(n_epochs, dtype = np.uint32)
for i in range(n_epochs):
    heads[i] = np.random.randint(0, 2, 2).sum()
plt.stem(np.bincount(heads), use_line_collection=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1279527559055118, 'fraction_numerical': 0.027559055118110236, 'mean_word_length': 5.918367346938775, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '500506', 'license': 'MIT', 'n_tokens_mistral': 424, 'n_tokens_neox': 396, 'n_words': 97, 'path': 'notebook-samples/ds-stats/statistics review.ipynb', 'repo_name': 'MarkMoretto/python-examples-main', 'size': '1016'}