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' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Shannon Index
by kulls (Hermit) on Sep 13, 2006 at 03:31 UTC |