If we believe a quantity changes smoothly, so that inputs close together have similar outputs, how can we turn the distance between two inputs into a similarity score between 0 and 1, and what does the length-scale control?

Probabilistic models, Gaussian processes
Level L1 Beginner. Length Short. Nature Th+Mat Both.

What's being asked

Whether you understand the idea of smoothness as similarity that fades with distance, which is the building block of kernel methods and Gaussian processes.

Key idea

A similarity function (kernel) gives 1 for identical inputs and falls towards 0 as inputs move apart. The common Gaussian (RBF, radial basis function) choice is k(x,x′)=exp⁡ ⁣(−d2/(2ℓ2)), where d=∣x−x′∣ and the length-scale ℓ says how far you can move before the similarity mostly disappears.

Steps

  1. Start with an everyday case: the temperature at 2 pm and 3 pm are close, and at 2 pm and 2 am they are not. Smoothness means that knowing the value at one input tells you a lot about nearby inputs and little about faraway ones.
  2. Turn closeness into a number with k(x,x′)=exp⁡ ⁣(−d2/(2ℓ2)), where d is the distance between the inputs and ℓ>0 is the length-scale. At d=0 it is e0=1 (identical), and it shrinks towards 0 as d grows.
  3. Tiny calculation: with ℓ=1 and d=2, the score is exp⁡(−4/2)=e−2≈0.14. These two inputs are only weakly related.
  4. Read ℓ as a distance scale. A small ℓ means the score drops quickly, so the quantity can wiggle fast. A large ℓ means the same distance still gives a score near 1, so the quantity changes slowly and looks smooth.
  5. Why this matters: a Gaussian process uses exactly such scores to say how strongly the values of an unknown function at different inputs are tied together. Choosing the length-scale is choosing how wiggly the function is allowed to be.

Common mistakes

How long your answer should be

Under 2 minutes, 4–6 sentences.

Read this

Previous in Probabilistic models: Two weather forecasters both predict tomorrow's temperature correctly, but one made a vague forecast and the other a specific one. Why does the specific one deserve more credit, and how does this explain why Bayesians say a model that can explain almost anything is penalised without any extra penalty?
Next in Probabilistic models: In a topic model, why do we describe each document as a mixture of topics, and each topic as a list of favourite words, and what is a tiny example?