Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #30257
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2014-10-30 08:12 -0700 |
| References | <2a713db5-9dbe-4325-9dc5-c781649861ce@googlegroups.com> |
| Message-ID | <3bfdecda-6d5f-4fcc-9075-3b45adfe4471@googlegroups.com> (permalink) |
| Subject | Re: Regression |
| From | FredK <fred.l.kleinschmidt@gmail.com> |
On Monday, October 27, 2014 7:57:58 AM UTC-7, gotts...@gmail.com wrote:
> Cant seem to figure out the correlation portion and the standard deviation portion either. Could use some help. Thank you all very much.
> public static double mean(double[] chirp)
> {
> double sum = 0;
> for (int i = 0; i < chirp.length; i++)
> {
> sum += chirp[i];
>
> }
>
> return sum / chirp.length;
> }
>
This is a somewhat naive approach to computing a mean.
Consider what will happen here:
double[] xx = {Double.MAX_VALUE, 100.0};
double theMean = mean(xx);
The same problem exists in all of your functions.
--
Fred Kleinschmidt
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Regression gottshalk.j@gmail.com - 2014-10-27 07:57 -0700 Re: Regression Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-10-27 11:17 -0400 Re: Regression FredK <fred.l.kleinschmidt@gmail.com> - 2014-10-30 08:12 -0700
csiph-web