liveBook · Manning

Location parameter

As explained in Causal AI

A location parameter is a distribution parameter that determines the position of a distribution along its variable's scale.

A location parameter determines where a probability distribution sits along its variable’s scale. It acts like a map pin marking the distribution’s center or position, while leaving the role of spread to a scale parameter. For a normal distribution, μ is a location parameter and also the mean; other distributions can use location parameters that are not means. section 2.1.7

Separate the parameter roles when interpreting or configuring a distribution:

  • Location shifts the distribution along its variable’s scale. section 2.1.7
  • Scale controls how widely probability is spread around the location. section 2.1.7
  • Shape changes the distribution’s form rather than simply shifting, stretching, or shrinking it; rate parameters can play an inverse role to shape parameters. section 2.1.7

Normal distribution in Pyro

In Pyro, a normal distribution can be instantiated as `Normal(loc=0.0, scale=1.0)`. Here, `loc` supplies the distribution’s location and `scale` supplies its spread, making the conceptual distinction explicit in model code. section 2.1.7

Listing 2.3 Canonical parameters in Pyro
import torch
from pyro.distributions import Bernoulli, Categorical, Gamma, Normal    #1

print(Categorical(probs=torch.tensor([.45, .30, .25])))    #2
print(Normal(loc=0.0, scale=1.0))
print(Bernoulli(probs=0.4))
print(Gamma(concentration=1.0, rate=2.0))

Inspect the Pyro listing to compare `loc` and `scale` with the parameter interfaces of Bernoulli, Categorical, and Gamma distributions. section 2.1.7

How Causal AI covers it

How deep it goes
Defines positional behavior and contrasts location with scale and shape, stopping short of distribution-specific derivations.
Examples
Illustrates the idea through a city-center analogy and Pyro’s `Normal(loc=0.0, scale=1.0)` declaration.
What it assumes
Assumes familiarity with probability distributions while establishing the roles of distribution parameters from basic intuition.
What you can do after
Apply location parameters in Pyro by identifying the positional argument separately from distribution spread.
How it connects
Connects location parameters with probability distributions, canonical parameters, scale parameters, shape parameters, rate parameters, and Pyro.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal AI. The section links point to the parts of the book it draws on.