Understanding the Polya urn model I am having trouble understanding the plot below (taken from Edwin Chen's blog). 


*

*What is the x-axis supposed to represent? Shouldn't color be a categorical variable? Does the x-axis have to be on the real line for the Polya urn model?

*Are we supposed to see significant changes across runs for the same alpha?



 A: As I stated in the comments, I think the Pólya urn is used to draw the centers of some normal distributions, and that the plot is a mixture of normal distributions, which seems to make sense as the text you are pointing to is revolving around models for the position of cluster centroids.
Here is a piece of R code that generates similar plots.
polya_urn_model = function(base_color_distribution, num_balls, alpha) {
  balls = numeric(num_balls)
  for (i in 1:num_balls)
  {
     balls[i] <- ifelse( runif(1) < alpha / (alpha + i-1),
                 base_color_distribution(), sample(balls[1:(i-1)], 1))
  }
  return(balls)
}

my.graph <- function(alpha)
{
  N <- 1000;
  x <- polya_urn_model(function() rnorm(1), N, alpha)

  # the centers of the components
  c <- sort(unique(x))

  # their weights (proba of being in this component)
  w <- as.vector(table(x)/N);

  t <- seq(-5,5,length=501)
  # computes the density  d(t) =\sum_i w_i f_i(t) 
  # where f_i = density of N( c_i, σ = 0.4)
  d <- rowSums(mapply(function(ce,we) dnorm(t,mean=ce, sd=0.4)*we,c,w))
  plot(t, d, type="l")
}

A: *

*The X-axis is the support of the base distribution $G_0(x)$. In other words if $G_0(x)$ were a normal distribution then the X-axis would be the real number line. 

*Each of those plots corresponds to a random distribution, $G$, drawn from a Dirichlet Process, and smoothed with Gaussian kernels. Specifically, each of the point masses in $G$ is associated with a weighted Gaussian distribution at that location. The plots are of the resulting mixture of Gaussian density.  They're all a little different even for the same $\alpha$ because they are randomly sampled distributions. 
Note: I think the main source of confusion with these plots is that the X-axis is labeled "Color of ball" yet the plotted line is a continuous function. Perhaps it would have been less confusing if the plots also had colored spikes at the locations of each point mass, to symbolize ball colors. As they are, the plots conceal  these centroids. 
