in reply to Re^4: Shannon Index
in thread Shannon Index

You are passing $base_index as an additional data set. If you wish to retreive the index you use the index member and pass an optional base. Changling your last few lines to:

my $shannon=Statistics::Shannon->new($data,); my $output=$shannon->index ($base_index); print "Index: $output\n"; print Dumper($shannon);

Prints:

Index: 2.17095059445467 $VAR1 = bless( { 'shannon' => { '2' => '1.50478828368119' }, 'min' => 1, 'max' => 3, 'data' => { '6' => 2, '4' => 1, '1' => 1, '3' => 3, '2' => 3 }, 'update' => sub { "DUMMY" }, 'sum' => 10 }, 'Statistics::Shannon' );

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^6: Shannon Index
by kulls (Hermit) on Sep 13, 2006 at 03:31 UTC
    HI,
    Thanks for your reply.
    you're correct . I wrote this same issue to the author of this module and he is going to fix this issue. B'use, According to the POD it says that you can set the  $index value during object creation itself.
    Thanks once again, let me move on !
    kulls