Prediction by partial matching
   HOME

TheInfoList



OR:

Prediction by partial matching (PPM) is an adaptive statistical
data compression In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compressio ...
technique based on context modeling and prediction. PPM models use a set of previous symbols in the uncompressed symbol stream to predict the next symbol in the stream. PPM algorithms can also be used to cluster data into predicted groupings in cluster analysis.


Theory

Predictions are usually reduced to symbol rankings. Each symbol (a letter, bit or any other amount of data) is ranked before it is compressed, and the ranking system determines the corresponding codeword (and therefore the compression rate). In many compression algorithms, the ranking is equivalent to probability mass function estimation. Given the previous letters (or given a context), each symbol is assigned with a probability. For instance, in
arithmetic coding Arithmetic coding (AC) is a form of entropy encoding used in lossless data compression. Normally, a string of characters is represented using a fixed number of bits per character, as in the ASCII code. When a string is converted to arithmetic ...
the symbols are ranked by their probabilities to appear after previous symbols, and the whole sequence is compressed into a single fraction that is computed according to these probabilities. The number of previous symbols, ''n'', determines the order of the PPM model which is denoted as PPM(''n''). Unbounded variants where the context has no length limitations also exist and are denoted as ''PPM*''. If no prediction can be made based on all ''n'' context symbols, a prediction is attempted with ''n'' − 1 symbols. This process is repeated until a match is found or no more symbols remain in context. At that point a fixed prediction is made. Much of the work in optimizing a PPM model is handling inputs that have not already occurred in the input stream. The obvious way to handle them is to create a "never-seen" symbol which triggers the
escape sequence In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding (and possibly terminating) characters. Examples * In C and ma ...
. But what probability should be assigned to a symbol that has never been seen? This is called th
zero-frequency problem
One variant uses the
Laplace estimator In probability theory, the rule of succession is a formula introduced in the 18th century by Pierre-Simon Laplace in the course of treating the sunrise problem. The formula is still used, particularly to estimate underlying probabilities when ...
, which assigns the "never-seen" symbol a fixed pseudocount of one. A variant called PPMd increments the pseudocount of the "never-seen" symbol every time the "never-seen" symbol is used. (In other words, PPMd estimates the probability of a new symbol as the ratio of the number of unique symbols to the total number of symbols observed).


Implementation

PPM compression implementations vary greatly in other details. The actual symbol selection is usually recorded using
arithmetic coding Arithmetic coding (AC) is a form of entropy encoding used in lossless data compression. Normally, a string of characters is represented using a fixed number of bits per character, as in the ASCII code. When a string is converted to arithmetic ...
, though it is also possible to use
Huffman encoding In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algor ...
or even some type of dictionary coding technique. The underlying model used in most PPM algorithms can also be extended to predict multiple symbols. It is also possible to use non-Markov modeling to either replace or supplement Markov modeling. The symbol size is usually static, typically a single byte, which makes generic handling of any file format easy. Published_research_on_this_family_of_algorithms_can_be_found_as_far_back_as_the_mid-1980s._Software_implementations_were_not_popular_until_the_early_1990s_because_PPM_algorithms_require_a_significant_amount_of_Random_Access_Memory.html" "title="User:M.e">m.e. 10:34, 8 Oct 2004 (UTC)">User:M.e.html" ;"title="ee talk page User:M.e">m.e. 10:34, 8 Oct 2004 (UTC)--> Published research on this family of algorithms can be found as far back as the mid-1980s. Software implementations were not popular until the early 1990s because PPM algorithms require a significant amount of Random Access Memory">RAM Ram, ram, or RAM may refer to: Animals * A male sheep * Ram cichlid, a freshwater tropical fish People * Ram (given name) * Ram (surname) * Ram (director) (Ramsubramaniam), an Indian Tamil film director * RAM (musician) (born 1974), Dutch * ...
. Recent PPM implementations are among the best-performing lossless compression programs for natural language text. PPMd is an implementation of PPMII by Dmitry Shkarin. It is used in the RAR (file format), RAR by default. It is also used by 7-Zip as one of several possible compression methods in the 7z file format. Attempts to improve PPM algorithms led to the PAQ series of data compression algorithms. A PPM algorithm, rather than being used for compression, is used to increase the efficiency of user input in the alternate input method program Dasher.


See also

* Language model * ''n''-gram


Sources

* * * * C. Bloom
Solving the problems of context modeling
* W.J. Teahan

*


References


External links







* ttp://compression.ru/ds/ PPMd compressorby Dmitri Shkarin
PPM compression in C++
by René Puschinger {{Compression Methods Lossless compression algorithms