Yeh, I remembered that when I bombed out on a case with two samples so I have added a guard clause that I do not try to use LR if I have less than 10 samples. It appears to still have some very degenerate cases that kill this module with plenty of samples. I have now updated my code to divide Max(Y) by Min(Y) and use this 'change' value to alter the number of terms I use. Strangely it looks like cases where there is a sudden step change in the data that trigger this failure, I have one case where there is a 56% change and that kills the module.

# Lets play with order based on Max/Min value my $change = $data->{Max}{AVG_Percentage_Used} / $data->{Min}{AVG_ +Percentage_Used}; print "Change is $change\n"; my $order = 1; $order = 2 if $change > 1.05; $order = 3 if $change > 1.15; $order = 4 if $change > 1.30; my @Thetas = 'Const'; # Set Thetas for zero order push @Thetas, 'Theta'.$_ for 1 .. $order; my $reg = Statistics::Regression->new( $data->{Name}, \@Thetas ); # Add data points for ( @{$data->{values}} ) { my $epoch = mktime($s, $m, $h, $D, $M-1, $Y); my $x = $_->[2]; my @Data = 1; push @Data, $x**$_ for 1..$order; print "\$reg->include ( $epoch, [".(join ", ", @Data)." ] )\n" +; $reg->include ( $epoch, \@Data ); } print "Results are ...\n"; $reg->print();

That appear to guard the cases where I had very little movement in Y over the series, but this one still kills it. The value 'Change' in this debug is Max/Min, so here there is a 30% change

Change is 1.3 $reg->include ( 1491859118, [1, 3.25, 10.5625 ] ) $reg->include ( 1491902520, [1, 3.25, 10.5625 ] ) $reg->include ( 1492032609, [1, 2.5, 6.25 ] ) $reg->include ( 1492117432, [1, 2.5, 6.25 ] ) $reg->include ( 1492204208, [1, 2.5, 6.25 ] ) $reg->include ( 1492291088, [1, 2.5, 6.25 ] ) $reg->include ( 1492377875, [1, 2.5, 6.25 ] ) $reg->include ( 1492464416, [1, 2.5, 6.25 ] ) $reg->include ( 1492551241, [1, 2.5, 6.25 ] ) $reg->include ( 1492623578, [1, 2.5, 6.25 ] ) Results are ... **************************************************************** Regression 'gotsvl2143.dpcmsr1t.TOOLS' **************************************************************** Report.pl::Statistics::Regression:standarderrors: I cannot compute the + theta-covariance matrix for variable 3 0

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

In reply to Re^6: using Statistics::Regression by Random_Walk
in thread using Statistics::Regression by Random_Walk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.