#75 rms calculation flawed?

critical
closed
nobody
core (120)
5
2003-12-15
2003-12-01
No

I believe there's a bug in PDL::Primitive with the rms
equation.

It is currently:

$rms = sqrt( ((($data-$mean)**2 )->dsum) /
$npts );

I think it should be:

$rms = sqrt( ((($data-$mean)**2 )->dsum) /
($npts-1) );

This should be repeated for the weighted sum
calculation that follows as well. With the appropriate
divide by zero conditionals of course.

When I fixed the code the rms values agreed with similar
calculations done with Excel and Jump.

You can reach me at

jwelter@sawtek.com

Jason Welter

Discussion

  • Craig DeForest

    Craig DeForest - 2003-12-15

    Logged In: YES
    user_id=20200

    Bug fixed in CVS.
    Thanks for reporting the problem!

     
  • Craig DeForest

    Craig DeForest - 2003-12-15
    • status: open --> closed
     
  • Nobody/Anonymous

    Logged In: NO

    I think I was wrong now.

    Dividing by N is appropriate when calculating the rms for an entire
    population.

    Dividing by N-1 is appropriate when calculating the rms for a
    subgroup of the entire population.

    I think the first assumption is the most correct and think you should
    ignore my bug report...sorry.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks