Skip to content

Commit bf1c40c

Browse files
committed
0.20.0 Cheat sheets, splice, better validation
1 parent 7db5009 commit bf1c40c

27 files changed

+656
-1341
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,4 @@ venv.bak/
119119

120120

121121
doc/index - Copy.xrst
122+
cheat-sheets/preamble.fmt

README.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,33 @@ Installation
9797
Version History
9898
-----------------
9999

100-
0.18.0
100+
0.20.0 (release candidate for version 1.0)
101+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102+
103+
* ``sev_attachment``: changed default to ``None``; in that case gross losses equal
104+
ground-up losses, with no adjustment. But if layer is 10 xs 0 then losses
105+
become conditional on X > 0. That results in a different behaviour, e.g.,
106+
when using ``dsev[0:3]``. Ripple through effect in Aggregate (change default),
107+
Severity (change default, and change moment calculation; need to track the "attachment"
108+
of zero and the fact that it came from None, to track Pr attaching)
109+
* dsev: check if any elements are < 0 and set to zero before computing moments
110+
in dhistogram
111+
* same for dfreq; implemented in ``validate_discrete_distribution`` in distributions module
112+
* Default ``recommend_p=0.99999`` set in constsants module.
113+
* ``interpreter_test_suite`` renamed to ``run_test_suite`` and includes test
114+
to count and report if there are errors.
115+
* Reason codes for failing validation; Aggregate.qt becomes Aggregte.explain_validation
116+
117+
0.19.0
101118
~~~~~~~
102119

120+
* Fixed reinsurance description formatting
121+
* Improved splice parsing to allow explicit entry of lb and ub; needed to
122+
model mixtures of mixtures (Albrecher et al. 2017)
123+
124+
0.18.0 (major update)
125+
~~~~~~~~~~~~~~~~~~~~~~~
126+
103127
* Added ability to specify occ reinsurance after a built in agg; this
104128
allows you to alter a gross aggregate more easily.
105129
* ``Underwriter.safe_lookup`` uses deepcopy rather than copy to avoid
@@ -152,7 +176,7 @@ Version History
152176
new arguments ``sev_lb`` and ``sev_ub``, each lists.
153177
* ``Underwriter.build`` defaults update argument to None, which uses the object default.
154178
* pretty printing: now returns a value, no tacit mode; added _html version to
155-
run through pygments, that looks good in Jupyter Lab.
179+
run through pygments, that looks good in Jupyter Lab.
156180

157181
0.17.1
158182
~~~~~~~~

aggregate/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
sEngFormatter, mv, picks_work, GCN, lognorm_approx,
2020
integral_by_doubling, logarithmic_theta, block_iman_conover,
2121
make_var_tvar, test_var_tvar, kaplan_meier, kaplan_meier_np,
22-
more, parse_note, parse_note_ex, introspect)
22+
more, parse_note, parse_note_ex, introspect, explain_validation)
2323
from .spectral import Distortion, approx_ccoc
2424
from .distributions import Frequency, Severity, Aggregate
2525
from .portfolio import Portfolio, make_awkward
@@ -47,12 +47,12 @@
4747
__email__ = "[email protected]"
4848
__status__ = "beta"
4949
# only need to change here, feeds conf.py (docs) and pyproject.toml (build)
50-
__version__ = "0.19.0"
50+
__version__ = "0.20.0"
5151

5252

5353

5454
# as a default turn off all logging
55-
logger_level(10)
55+
logger_level(30)
5656
knobble_fonts()
5757

5858
# module level doc-string

aggregate/constants.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# constants
2+
from enum import Flag, auto
3+
24

35
__all__ = ['FIG_W', 'FIG_H', 'WL', 'FONT_SIZE', 'LEGEND_FONT',
4-
'PLOT_FACE_COLOR', 'FIGURE_BG_COLOR', 'VALIDATION_EPS']
6+
'PLOT_FACE_COLOR', 'FIGURE_BG_COLOR', 'VALIDATION_EPS',
7+
'RECOMMEND_P', 'Validation']
58

69
FIG_W = 3.5
710
FIG_H = 2.45
@@ -17,4 +20,17 @@
1720
PLOT_FACE_COLOR = 'lightsteelblue'
1821
FIGURE_BG_COLOR = 'aliceblue'
1922
VALIDATION_EPS = 1e-4
23+
RECOMMEND_P = 0.99999
24+
25+
class Validation(Flag):
26+
NOT_UNREASONABLE = auto()
27+
SEV_MEAN = auto()
28+
SEV_CV = auto()
29+
SEV_SKEW = auto()
30+
AGG_MEAN = auto()
31+
AGG_CV = auto()
32+
AGG_SKEW = auto()
33+
ALIASING = auto()
34+
REINSURANCE = auto()
35+
NOT_UPDATED = auto()
2036

aggregate/decl_pygments.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class AggLexer(RegexLexer):
5656
# (r'\<|\>', Generic.Heading),
5757
# the regex for an ID from parser.py
5858
(r'mixed ', Operator, 'mixed_freq'),
59-
(r'and', Name.Type),
60-
(r'splice', Name.Type),
59+
(r'and', Generic.Heading),
60+
(r'splice', Generic.Heading),
6161
(r'wts', Name.Type),
6262
include('numbers'),
6363
include('keywords'),
@@ -73,7 +73,8 @@ class AggLexer(RegexLexer):
7373
],
7474

7575
'mixed_freq': [
76-
(words(('gamma', 'delaporte', 'ig', 'sig', 'beta', 'sichel'),
76+
(words(('gamma', 'delaporte', 'ig', 'sig', 'beta', 'sichel', "<DISTRIBUTION>"),
77+
# last item is a hack for the AAS paper
7778
suffix=' '
7879
), Name.Function, '#pop'),
7980
(r'sichel\.', Name.Function)

0 commit comments

Comments
 (0)