What is the correlation if the standard deviation of one variable is 0? As I understand, we can get correlation by normalizing covariance using the equation
$$\rho_{i,j}=\frac{cov(X_i, X_j)}{\sigma_i \sigma_j}$$
where $\sigma_i=\sqrt{E[(X_i-\mu_i)^2]}$ is the standard deviation of $X_i$.
My concern is what if the standard deviation equals zero? Is there any condition that guarantees it cannot be zero?
Thanks.
 A: The other thing to think about are the underlying assumptions when we talk about means and standard deviations, and correlations. 
If we are talking about a data sample, one common assumption is that the data is (at least approximately) normally distributed, or can be transformed such that it is (e.g. via a log transform). If you observe a standard deviation of zero, there are two scenarios: either the standard deviation is in fact nonzero, but very small, and therefore the dataset you have has samples that are all on the mean value (this could, for example, happen if you are measuring data at a coarse level of precision); or the model is misspecified.
In this second scenario, the standard deviation, and consequently the correlation, is a meaningless measure.
More generally, the underlying distributions must both have finite second moments, and therefore non-zero standard deviations, for the correlation to be a valid concept.
A: A correlation is the cosine of the angle between two vectors. To say that the standard deviation for Y is zero is the same as saying that the vector Y-mean(Y) is zero (or, more rigorously, that it represents zero in the appropriate vector space). So the question becomes "What can one say about the (cosine of the) angle between the zero vector and the vector X-mean(X)?". More generally, in any vector space with an inner product, what is meant by the angle between the zero vector and some other vector? There's only one answer to this, in my opinion, and that is that the concept of "angle" in this situation is meaningless, and so the concept of correlation in this situation is meaningless.
A: It's true that, if one of your SD's is 0, that equation is undefined.  However, a better way to think about this is that if one of your SD's is 0, there is no correlation.  In loose conceptual terms, a correlation is telling you about how one variable moves around as the other variable moves around.  An SD of 0 implies that variable is not 'moving around'.  You would have to have a vector of a constant, such as rep(constant, n_times).  
A: Disclaimer, I realize that there is already an accepted quality answer, so this should be a response, but I don't have the experience points to allow it.  @Dilip mentioned that you can define the correlation as 0 for convention, but this seems problematic as it would have very different interpretation from a correlation that is truly zero (with non-zero SDs).  The original question says "if the SD of one variable is zero".  If we just stop and think of the definition of 'variable' then we get a much more direct path to the answer.  A variable with 0 SD is not a variable at all, it is a constant.  So in that case you don't have two variables, so it conceptually doesn't make sense to define a correlation at all. 
