JuliaStats/Distributions.jl — pull request #15 by kmsquire (2013-02-15 07:00:29+00:00)
Title: Added mean, var 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 is based the expected value of the statement, `[x = i]`, which is just `p_i`.

An alternate version (requested separately) actually calculates the mean and variance of `x` using standard definitions.

(My preference is the other request.)