# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Quantile Tests
#
# Illustrates the various problems with quantiles and shows that the `Aggregate` and `Portfolio` classes handle them correctly. 

# +
import sys
sys.path.append("c:\\s\\telos\\python\\aggregate_project")
sys.path.append("c:\\s\\telos\\python\\aggregate_extensions_project")

import aggregate as agg
import aggregate_extensions as agg_ext
import aggregate_extensions.allocation as aea

import numpy as np
import matplotlib.pyplot as plt
# from matplotlib.ticker import MultipleLocator, FormatStrFormatter, StrMethodFormatter, FuncFormatter, \
#                                AutoMinorLocator, MaxNLocator, NullFormatter, FixedLocator, FixedFormatter
import pandas as pd
# from jinja2 import Template
# import seaborn as sns
from IPython.core.display import HTML
import itertools
# sns.set('paper', 'ticks', 'plasma', 'serif')
# sns.set_palette('muted', 8)
# %config InlineBackend.figure_format = 'svg'
pd.set_option('display.max_rows', 500)
# pd.set_option('display.max_cols', 500)

# https://github.com/matplotlib/jupyter-matplotlib
# %matplotlib widget
# # %matplotlib

from importlib import reload

import logging
aggdevlog = logging.getLogger('aggdev.log')
aggdevlog.setLevel(logging.INFO)
print(agg.__file__)

# print(agg.__file__, agg.__version__)
# import os
# print(os.environ['CONDA_DEFAULT_ENV'])
# print(os.getcwd())
# # x = !dir *.ipynb
# -





uw = agg.Underwriter(update=False, create_all=False)
port = uw('''
port tester
    agg Athin  1 claim sev dhistogram xps [0 9 10] [.98 .01 .01] fixed
    agg Dthick 1 claim sev dhistogram xps [0 1 90] [.98 .01 .01] fixed
''')
port.update(bs=1, log2=8, remove_fuzz=True)

port.q(0.98, kind='lower'), port.q(0.98, kind='upper')

port.q_temp



StarcoderdataJupyterScriptsDedupFiltered