{'fraction_non_alphanumeric': 0.02794759825327511, 'fraction_numerical': 0.0, 'mean_word_length': 5.701754385964913, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Estimation and Stress-Testing via Time- and Market-Conditional Flexible Probabilities

In the Flexible Probabilities approach, given the historical distribution (histogram) of the returns of a portfolio, we can stress-test the portfolio under different time periods and market environments, by adjusting the relative weights (Flexible Probabilities) of the historical returns in the histogram. This paper presents a detailed description of how to specify the Flexible Probabilities to perform the above stress-tests. First, we discuss Time-Conditional Flexible Probabilities, which generalize the well-known GARCH-like exponential smoothing of the covariance matrix, and Market-Conditional Flexible Probabilities, which generalize the non-parametric technique known as kernel smoothing. Next, we discuss how to blend time conditioning and market conditioning via Entropy Pooling. Finally, we show how to specify a whole set of Flexible Probabilities, each with a different weight. The ensuing ensemble of Flexible Probabilities allows us to perform distributional stress-testing of our portfolio. Fully documented code is available for download.