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
