JuliaStats/Distributions.jl — pull request #16 by kmsquire (2013-02-15 07:01:26+00:00)
Title: Alternate definition of mean, variance for Categorical distribution.

In order to display properly, it seems that all Distributions need to have `mean` and `var` defined. This does so for the Categorical distribution.

There is more than one possible way to define the mean and variance for the Categorical distribution. This version calculates the mean and variance of `x` using standard definitions.

An alternate version (requested separately) is based the expected value of the statement, `[x = i]`, which is just `p_i`.

(My preference is this request.)