<jupyter_start><jupyter_text>대표적인 연속형 확률분포<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from scipy import stats, integrate
from scipy.optimize import minimize_scalar
from ipywidgets import interact

%precision 3
%matplotlib inline<jupyter_output><empty_output><jupyter_text>그림 8.5 다양한 정규분포<jupyter_code>@interact(mean=(-3, 3, 0.1), sigma=(0.1, 10.0, 0.1))
def N(mean=0, sigma=1):
    xs = np.linspace(-6, 6, 1000)
    fig = plt.figure(figsize=(10, 6))
    ax = fig.add_subplot(111)
    rv = stats.norm(mean, sigma)
    ax.plot(xs, rv.pdf(xs))
    ax.set_xlim(-6, 6)
    ax.set_ylim(-0.02, 3)
    plt.show()<jupyter_output><empty_output><jupyter_text>그림 8.7 다양한 지수분포<jupyter_code>@interact(l=(0.1, 5, 0.1))
def Ex(l=0.1):
    xs = np.linspace(0, 2, 100)
    fig = plt.figure(figsize=(10, 6))
    ax = fig.add_subplot(111)
    rv = stats.expon(scale=1/l)
    ax.plot(xs, rv.pdf(xs))
    ax.set_xlim(-0.02, 2)
    ax.set_ylim(-0.02, 5)
    plt.show()<jupyter_output><empty_output><jupyter_text>그림 8.9 다양한 카이제곱분포<jupyter_code>@interact(n=(1, 20, 1))
def chi2(n=1):
    xs = np.linspace(0, 20, 1000)
    fig = plt.figure(figsize=(10, 6))
    ax = fig.add_subplot(111)
    rv = stats.chi2(n)
    ax.plot(xs, rv.pdf(xs))
    ax.set_xlim(-0.02, 20)
    ax.set_ylim(-0.02, 1)
    plt.show()<jupyter_output><empty_output><jupyter_text>그림 8.11 다양한 t분포<jupyter_code>@interact(n=(1, 30, 1))
def t(n=1):
    xs = np.linspace(-3, 3, 100)
    fig = plt.figure(figsize=(10, 6))
    ax = fig.add_subplot(111)
    rv = stats.t(n)
    ax.plot(xs, rv.pdf(xs), label='t')
    rv = stats.norm(loc=0, scale=1)
    ax.plot(xs, rv.pdf(xs), 'k', label='N(0, 1)')
    ax.set_ylim(-0.02, 0.5)
    ax.legend()
    plt.show()<jupyter_output><empty_output><jupyter_text>그림 8.13 다양한 F분포<jupyter_code>@interact(n1=(1, 10, 1), n2=(1, 10, 1))
def f(n1=5, n2=5):
    xs = np.linspace(0, 6, 200)[1:]
    fig = plt.figure(figsize=(10, 6))
    ax = fig.add_subplot(111)
    rv = stats.f(n1, n2)
    ax.plot(xs, rv.pdf(xs))
    ax.set_xlim(-0.02, 6)
    ax.set_ylim(-0.02, 1)
    plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18970448045757865, 'fraction_numerical': 0.0767397521448999, 'mean_word_length': 3.7274774774774775, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '163909', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1094, 'n_words': 170, 'path': 'animation/chap08_anim.ipynb', 'repo_name': 'mizz0224/Probability-and-statistics', 'size': '2098'}