ArticleslgStudy

computer science

Prediction by partial matching

Prediction by partial matching is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Prediction by partial matching rather than just read about it. In short: Prediction by partial matching (PPM) is an adaptive statistical data compression 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.

Key takeaways

  • Prediction by partial matching belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Prediction by partial matching to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Prediction by partial matching from memory before moving on to harder problems.

Reference excerpt

Prediction by partial matching (PPM) is an adaptive statistical data compression 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 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. But what probability should be assigned to a symbol that has never been seen? This is called the zero-frequency problem. One variant uses the Laplace estimator, 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, though it is also possible to use Huffman encoding 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. The PPM family of algorithms originated with work by John G. Cleary and Ian H. Witten, who described adaptive coding using partial string matching in 1984. Their experiments reported compression of mixed-case English text to as little as 2.2 bits per character. PPMd is a public domain implementation of PPMII (PPM with information inheritance) by Dmitry Shkarin which has undergone several incompatible revisions. It is used in the RAR file format by default. It is also available in the 7z and zip file formats. 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 Cleary, J.; Witten, I. (April 1984). "Data Compression Using Adaptive Coding and Partial String Matching". IEEE Trans. Commun. 32 (4): 396–402. CiteSeerX 10.1.1.14.4305. doi:10.1109/TCOM.1984.1096090. {{cite journal}}: Cite uses deprecated parameter |citeseerx= (help) Moffat, A. (November 1990). "Implementing the PPM data compression scheme". IEEE Trans. Commun. 38 (11): 1917–1921. CiteSeerX 10.1.1.120.8728. doi:10.1109/26.61469. {{cite journal}}: Cite uses deprecated parameter |citeseerx= (help) Cleary, J. G.; Teahan, W. J.; Witten, I. H. (1997). "Unbounded length contexts for PPM". The Computer Journal. 40 (2_and_3). Oxford, England: Oxford University Press: 67–75. doi:10.1093/comjnl/40.2_and_3.67. ISSN 0010-4620. C. Bloom, Solving the problems of context modeling. W.J. Teahan, Probability estimation for PPM, Original Source from archive.org. Schürmann, T.; Grassberger, P. (September 1996). "Entropy estimation of symbol sequences". Chaos. 6 (3): 414–427. arXiv:cond-mat/0203436. Bibcode:1996Chaos...6..414S. doi:10.1063/1.166191. PMID 12780271. S2CID 10090433.

References

Worked examples

Example 1 — a first encounter with Prediction by partial matching

Start with the simplest possible case. Write down what Prediction by partial matching claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Prediction by partial matching before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Prediction by partial matching ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Prediction by partial matching

In research
Prediction by partial matching appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Prediction by partial matching in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Prediction by partial matching is common in secondary-school and first-year university syllabi. It links to neighbouring topics Data compression, Lossless compression algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Prediction by partial matching outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Prediction by partial matching in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Prediction by partial matching means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Prediction by partial matching out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Prediction by partial matching in simple terms?

Prediction by partial matching (PPM) is an adaptive statistical data compression 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.

Why does Prediction by partial matching matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Prediction by partial matching?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Prediction by partial matching.

Tags

  • Data compression
  • Lossless compression algorithms

Keep exploring