# What does "$\sim$" mean and $A | B \sim C$?

I'm not sure if I fully understand the meaning of the symbol, I've seen this symbol in various articles but haven't managed to understand what they implied. I did some reading and it looks like $A \sim B$ means B-Distribution of random variable $A$.

Then how would it apply in continuous case as this $$\epsilon_{ij}\sim F$$ $$F\sim DP$$

where $\epsilon$ is noise and DP means Dirichlet process?

Then it gets more complicated with $A | B \sim C$ such as Dirichlet process mixture models. Like is the left-hand side denoting $\theta$ given $G$?

$$\theta_i|G \sim G$$ $$x_i|\theta_i \sim F(\theta_i)$$

source

• I usually verbalize $\sim$ as "is distributed as", and $|$ as either "conditionally on" or perhaps more often, "given", so "$x_i|\theta_i \sim F(\theta_i)$" reads "$x_i$ given $\theta_i$ is distributed as $F(\theta_i)$" Feb 10, 2014 at 22:28

Usually ~ means "has the distribution...", so you are correct.

A ~ B, means that the random variable A has the distribution B (or is distributed equal to B).

In the article you mentioned DP is described as a distribution (see page 05, Dirichlet Processes):

A Dirichlet process DP($\alpha_0$;$G_0$) is defined to be the distribution of a random probability measure G over ($\theta$;$\beta$) such that...

The symbol "|" means "given" what comes next. It is used to express condition.

For example $\theta_i$ given G, has the distribution G.

On page 7, Equation 9, the text says:

where $F(\theta_i)$ denotes the distribution of the observation $x_i$ given $i$.

• How do you resolve the apparent overloading of meanings where the authors use (for instance) the term "$G_j$" both in the role of distribution and parameter?
– whuber
Feb 10, 2014 at 18:37
• @whuber, for what I understood $G_j$ can be both a distribution and also a parameter inside a DP process (last paragraph, page 8, equations 13 and 14). I would try to resolve the "apparent overloading of meanings" checking in which side of ~ the term $G_j$ is (if left: random measurements, if right: specific distribution. If $G_j$ is inside brackets it would indicate a parameter from the distribution. But I have a feeling this is not what you asked, is it? Feb 10, 2014 at 19:09
• It's just that I found this (ab)use of notation to be extremely confusing (which makes me sympathetic to the O.P.). Parameters and their distributions are such different mathematical objects that this overloading looks awfully ambiguous.
– whuber
Feb 10, 2014 at 19:13
• @whuber, I'm not seeing any explicit reference by the authors to $G_j$ as a parameter, but I would not be terribly surprised if they do, as $G_j$ is in fact a distribution that is random. In a topic model with an HDP prior, $G_j$ is the topic weights for the $j^{th}$ document, as explained on page 18. Feb 10, 2014 at 19:14
• The statement "$\theta_{ij} | G_j \sim G_j$" uses "$G_j$" in the role of parameter-cum-random variable (in its first appearance) and of distribution (in its second appearance). That's very explicit--and extraordinarily confusing. Lexically it looks like a self-reference, but evidently it's not.
– whuber
Feb 10, 2014 at 20:31

The ~ symbol means 'distributed according to'. So $a \sim G$ means the random variable $a$ is distributed according to the distribution $G$.

The bar symbol, as in $x_i|\theta_i \sim F(\theta_i)$, means "given". You shouldn't let it confuse you. It's often used in hierarchical models to emphasize that the lower stage of the model depends on the stage above it.