o2bwise has asked for the wisdom of the Perl Monks concerning the following question:
my %raw_data = ( 1 => 100, 2 => 160, 2.5 => 182, 3 => 225 ); my $regr = regression->new(\%raw_data); print '$regr= ', Dumper($regr); $mean_x = $regr->get_mean_x; print '$mean_x= ', Dumper($mean_x);
$regr= $VAR1 = bless( { 'mean_y' => '166.75', 'raw_data' => { '1' => 100, '3' => 225, '2' => 160, '2.5' => 182 }, 'slope' => '60.6285714285714', 'mean_x' => '2.125', 'y_intercept' => '37.9142857142857' }, 'regression' );
$raw_dataPtr = \%{$element_stats_hash{$element_name}{'raw_data +'}}; $$raw_dataPtr{$time} = {$var};
#$regr = regression->new(\%{$element_stats_hash{$element_name}{'ra +w_data'}}); $regr = regression->new(\%{$element_stats_hash{$element_name}}); print TEST '$regr= ', Dumper($regr);
$regr = regression->new(\%{$element_stats_hash{$element_name}}); print TEST '$regr= ', Dumper($regr);
'raw_data' => { '1229265435' => { '0. +12205589' => undef }, '1229299036' => { '0. +71940041' => undef }, '1229317107' => { '1. +22392523' => undef },
'raw_data' => { '1229265435' => '0.12 +205589', '1229299036' => '0.71 +940041', '1229317107' => '1.2239252 +3' },
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Confounded With A Simple Self-Made Perl Mod
by GrandFather (Saint) on Dec 15, 2008 at 23:18 UTC | |
|
Re: Confounded With A Simple Self-Made Perl Mod
by almut (Canon) on Dec 15, 2008 at 23:17 UTC | |
by o2bwise (Scribe) on Dec 16, 2008 at 20:09 UTC | |
by almut (Canon) on Dec 16, 2008 at 21:20 UTC |