<jupyter_start><jupyter_text>Ellipse ScalingThe code to calculate the percentages included in ellipses with various values of "k" in `plot.py`.Thanks to @senselessDev, January 26, for providing the code in [PR 1067](https://github.com/borglab/gtsam/pull/1067).<jupyter_code>import scipy
import scipy.stats
import numpy as np
def pct_to_sigma(pct, dof):
    return np.sqrt(scipy.stats.chi2.ppf(pct / 100., df=dof))

def sigma_to_pct(sigma, dof):
    return scipy.stats.chi2.cdf(sigma**2, df=dof) * 100.
for dof in range(0, 4):
    print("{}D".format(dof), end="")
    for sigma in range(1, 6):
        if dof == 0: print("\t    {}    ".format(sigma), end="")
        else: print("\t{:.5f}%".format(sigma_to_pct(sigma, dof)), end="")
    print()
for dof in range(1, 4):
    print("{}D\n".format(dof))
    for pct in [50, 95, 99]:
        print("pct={:.1f} -> sigma={:.12f}".format(pct, pct_to_sigma(pct, dof)))
    print()<jupyter_output>1D

pct=50.0 -> sigma=0.674489750196
pct=95.0 -> sigma=1.959963984540
pct=99.0 -> sigma=2.575829303549

2D

pct=50.0 -> sigma=1.177410022515
pct=95.0 -> sigma=2.447746830681
pct=99.0 -> sigma=3.034854258770

3D

pct=50.0 -> sigma=1.538172254455
pct=95.0 -> sigma=2.795483482915
pct=99.0 -> sigma=3.368214175219
{'fraction_non_alphanumeric': 0.17736757624398075, 'fraction_numerical': 0.14686998394863562, 'mean_word_length': 3.9681274900398407, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 14, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '68975', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 654, 'n_tokens_neox': 542, 'n_words': 109, 'path': 'python/gtsam/notebooks/ellipses.ipynb', 'repo_name': 'ywkim0606/gtsam', 'size': '1246'}