#22 bug in threaded fitypoly1d

closed-fixed
other (94)
5
2001-07-14
2001-07-03
Anonymous
No

Solaris 2.8, PDL 2.2.1

I'm using fitpoly1d to fit several data sets in a
single piddle (i.e., it's threading over the extra
dimension. If I fit the data sets individually, I get
different results than if I have fitpoly1d thread over
them.

I've uploaded a tgz file to sourceforge which contains
the script and data illustrating the problem.

Here's the script:

use PDL;
use PDL::Fit::Polynomial;

$x = rfits('x.fits');
$t = rfits('time.fits');

print "individually:\n";
foreach ( 0..2 )
{
( $n, $coef ) = fitpoly1d( $t->mslice([],[$_]),
$x->mslice([],[$_]), 5 );
print $coef;
}

print "one fell swoop:\n";

( $n, $coef ) = fitpoly1d( $t, $x, 5 );

print $coef;

Here's the output that I get:

individually:

[
[ 5420.1079 -15.290094 0.015905702
-7.2523313e-06 1.2251853e-09]
]

[
[ 2447.4823 -5.2352374 0.0039385447
-1.1753505e-06 1.0054531e-10]
]

[
[ -8550.2749 22.739 -0.022433173
9.7168204e-06 -1.5564548e-09]
]
one fell swoop:

[
[ 5426.1047 -15.304989 0.015919553
-7.258047e-06 1.2260684e-09]
[ 2448.39 -5.2376613 0.0039409674
-1.176425e-06 1.0072366e-10]
[ -8554.8412 22.752149 -0.022447345
9.7235949e-06 -1.5576668e-09]
]

Thanks,
Diab

Discussion

  • gzipped tar file containing script and data

     
    Attachments
  • Logged In: YES
    user_id=1120

    Normalization wasn't threaded. Fixed in CVS.

     
    • assigned_to: nobody --> csopen
    • status: open --> closed-fixed