Commits

barbasa committed 4760049

Minor fixes + MANIFEST update

Comments (0)

Files changed (7)

Statistics-Descriptive/MANIFEST

 examples/statistical-analysis.pl
 inc/Test/Run/Builder.pm
 lib/Statistics/Descriptive.pm
+lib/Statistics/Descriptive/Smoother.pm
+lib/Statistics/Descriptive/Smoother/Exponential.pm
+lib/Statistics/Descriptive/Smoother/Weightedexponential.pm
 rejects/descr.t
 scripts/tag-release.pl
 t/00-load.t
 t/descr.t
+t/descr_smooth_methods.t
 t/freq_distribution-1-rt-34999.t
 t/mode.t
 t/outliers.t
 t/pod-coverage.t
 t/pod.t
 t/quantile.t
+t/smoother.t
+t/smoother_exponential.t
+t/smoother_weightedexponential.t
 META.json

Statistics-Descriptive/lib/Statistics/Descriptive/Smoother.pm

 
 use strict;
 use warnings;
+
 use Carp;
 
 our $VERSION = '3.0500';

Statistics-Descriptive/lib/Statistics/Descriptive/Smoother/Weightedexponential.pm

 use strict;
 use warnings;
 
+use Carp;
 use base 'Statistics::Descriptive::Smoother';
-use Carp;
 
 our $VERSION = '3.0500';
 

Statistics-Descriptive/t/descr_smooth_methods.t

 
     my @smoothed_data = $stats->get_smoothed_data();
 
-    #TEST
+    # TEST
     is_deeply( \@smoothed_data, \@expected_values, 'Smoothing with C=0.5');
 }

Statistics-Descriptive/t/smoother.t

            samples  => [100, 100, 100],
     });
 
-    #TEST
+    # TEST
     isa_ok ($smoother, 'Statistics::Descriptive::Smoother::Exponential', 'Exponential class correctly created');
 }
 
            samples  => [100, 100, 100],
     });
 
-    #TEST
+    # TEST
     isa_ok ($smoother, 'Statistics::Descriptive::Smoother::Weightedexponential', 'Weightedexponential class correctly created');
     
 }
 {
 
     # Test invalid smoothing method
-    #TEST
+    # TEST
     dies_ok (sub {
                 Statistics::Descriptive::Smoother->instantiate({
                         method   => 'invalid_method',
            samples  => [100, 100, 100],
         });
 
-    #TEST
+    # TEST
     is ($smoother_neg, undef, 'Invalid coefficient: < 0');
 
     my $smoother_pos = Statistics::Descriptive::Smoother->instantiate({
            samples  => [100, 100, 100],
         });
 
-    #TEST
+    # TEST
     is ($smoother_pos, undef, 'Invalid coefficient: > 1');
  
 }
            samples  => [100],
         });
 
-    #TEST
+    # TEST
     is ($smoother, undef, 'Insufficient number of samples');
 
 }
            samples  => [100, 100, 100],
         });
 
-    #TEST
+    # TEST
     is ($smoother->get_smoothing_coeff(), 0.5, 'get_smoothing_coeff');
 
     my $ok = $smoother->set_smoothing_coeff(0.7);
 
-    #TEST
+    # TEST
     ok ($ok, 'set_smoothing_coeff: set went fine');
 
-    #TEST
+    # TEST
     is ($smoother->get_smoothing_coeff(), 0.7, 'set_smoothing_coeff: correct value set');
 
     my $ok2 = $smoother->set_smoothing_coeff(123);
 
-    #TEST
+    # TEST
     is ($ok2, undef, 'set_smoothing_coeff: set failed');
 
-    #TEST
+    # TEST
     is ($smoother->get_smoothing_coeff(), 0.7, 'set_smoothing_coeff: value not modified after failure');
 
 }

Statistics-Descriptive/t/smoother_exponential.t

     my @smoothed_data = $smoother->get_smoothed_data();
 
     # When the smoothing coefficient is 0 the series is not smoothed
-    #TEST
+    # TEST
     is_deeply( \@smoothed_data, \@original_data, 'No smoothing C=0');
 }
 
 
     # When the smoothing coefficient is 1 the series is universally equal to the initial unsmoothed value
     my @expected_values = map { $original_data[0] } 1 .. $smoother->{count};
-    #TEST
+    # TEST
     is_deeply( \@smoothed_data, \@expected_values, 'Max smoothing C=1');
 }
 
           9.001953125
     /; 
 
-    #TEST
+    # TEST
     is_deeply( \@smoothed_data, \@expected_values, 'Smoothing with C=0.5');
 }
 

Statistics-Descriptive/t/smoother_weightedexponential.t

     my @smoothed_data = $smoother->get_smoothed_data();
 
     # When the smoothing coefficient is 0 the series is not smoothed
-    #TEST
+    # TEST
     is_deeply( \@smoothed_data, \@original_data, 'No smoothing C=0');
 }
 
 
     # When the smoothing coefficient is 1 the series is universally equal to the initial unsmoothed value
     my @expected_values = map { $original_data[0] } 1 .. $smoother->{count};
-    #TEST
+    # TEST
     is_deeply( \@smoothed_data, \@expected_values, 'Max smoothing C=1');
 }
 
                     8.73457937329917
     /; 
 
-    #TEST
+    # TEST
     is_deeply( \@smoothed_data, \@expected_values, 'Smoothing with C=0.5');
 }
 
            samples  => [1,2,3],
     });
 
-    #TEST
+    # TEST
     is ( $smoother, undef, 'Different number of samples and data');
 }