Search the web
Sign In
New User? Sign Up
jsci
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
NormalDistribution.getVariance() incorrect   Message List  
Reply | Forward Message #122 of 369 |
Downloaded today and playing around with ... Created a new
NormalDistribution object, nd, with the constructor
NormalDistribution(double[] array). Called nd.getVariance() and it
is returning a negative number. If this method is supposed to return
the sample variance, then the following line of code, line 46:

variance=mean*mean-sumX2/array.length;

should be changed to:

variance = (sumX2 - array.length*mean*mean)/(array.length - 1);

Is my thinking correct that getVariance() should return the sample
variance after using the constructor with a data set?

~matt




Mon Apr 19, 2004 12:26 am

usg568i
Offline Offline
Send Email Send Email

Forward
Message #122 of 369 |
Expand Messages Author Sort by Date

Downloaded today and playing around with ... Created a new NormalDistribution object, nd, with the constructor NormalDistribution(double[] array). Called...
Matt Dean
usg568i
Offline Send Email
Apr 19, 2004
12:26 am

Yep, you are right. Thanks for fixing that....
Mark
mj_hale
Offline Send Email
Apr 24, 2004
5:49 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help