{'fraction_non_alphanumeric': 0.024, 'fraction_numerical': 0.0, 'mean_word_length': 5.014423076923077, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Finite-memory least squares universal prediction of individual continuous sequences

In this paper we consider the problem of universal prediction of individual continuous sequences with square-error loss, using a deterministic finite-state machine (FSM). The goal is to attain universally the performance of the best constant predictor tuned to the sequence, which predicts the empirical mean and incurs the empirical variance as the loss. The paper analyzes the tradeoff between the number of states of the universal FSM and the excess loss (regret). We first present a machine, termed Exponential Decaying Memory (EDM) machine, used in the past for predicting binary sequences, and show bounds on its performance. Then we consider a new class of machines, Degenerated Tracking Memory (DTM) machines, find the optimal DTM machine and show that it outperforms the EDM machine for a small number of states. Incidentally, we prove a lower bound indicating that even with large number of states the regret of the DTM machine does not vanish. Finally, we show a lower bound on the achievable regret of any FSM, and suggest a new machine, the Enhanced Exponential Decaying Memory, which attains the bound and outperforms the EDM for any number of states.