On Tue, Aug 11, 2009 at 12:11 AM, Ted Dunning<[email protected]> wrote:
> *llr <- function(x) { 2*(entropy(rowSums(x)) + entropy(colSums(x)) -
> entropy(x))}
> *
>
> I moved around some minus signs to make me happy, btw. All that
> matters in the end is that entropy and llr both give positive values.
>
I am not sure if I am doing it right. I get all entropy values
positive. But, the LLR value is negative, if calculated as above. LLR
will be positive positive if the equation as specified on the blog is
used ie.
llr <- function(x) { 2*( entropy(x) - entropy(rowSums(x)) -
entropy(colSums(x)))}
--shashi