SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > General > General Topics
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 10-27-14, 02:49 PM   #1
Aktungbby
Gefallen Engel U-666
 
Aktungbby's Avatar
 
Join Date: Jul 2013
Location: On a tilted, overheated, overpopulated spinning mudball on Collision course with Andromeda Galaxy
Posts: 30,066
Downloads: 24
Uploads: 0


Default That's not mean deviation-that's CRUEL deviation!

^ I see it so clearly now; Jeff! You've got it in a nutshell!I didn't know air guns were so complicated.
__________________

"Only two things are infinite; The Universe and human squirrelyness?!!
Aktungbby is offline   Reply With Quote
Old 10-27-14, 03:16 PM   #2
ikalugin
Ocean Warrior
 
Join Date: Aug 2014
Location: Moscow, Russia
Posts: 3,212
Downloads: 8
Uploads: 0


Default

Err you don't really need to create an object (class) for this, a simple function should do just fine.
ikalugin is offline   Reply With Quote
Old 10-28-14, 09:38 AM   #3
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,656
Downloads: 137
Uploads: 0


Default

Yep. A new function is plenty good enuff. I don't like adding some monster package I'll never use.
Jeff-Groves is offline   Reply With Quote
Old 10-28-14, 09:47 AM   #4
Eichhörnchen
Starte das Auto
 
Eichhörnchen's Avatar
 
Join Date: Aug 2014
Location: The Fens
Posts: 17,468
Downloads: 5
Uploads: 0


Default

Nothing worse than having a monster package and never using it.
Eichhörnchen is online   Reply With Quote
Old 10-28-14, 10:52 AM   #5
Pisces
Silent Hunter
 
Join Date: Dec 2004
Location: AN9771
Posts: 4,904
Downloads: 304
Uploads: 0
Default

I have never understood why it has to divide by N-1. Can anyone explain why it is less 1?

I mean, simple averages are simply the sum divided by N. That makes sense to spread the (sum of) differences accross all samples.
Pisces is offline   Reply With Quote
Old 10-28-14, 01:34 PM   #6
Tango589
Still crazy as ever!
 
Tango589's Avatar
 
Join Date: Jan 2008
Location: A little south of sanity
Posts: 3,377
Downloads: 180
Uploads: 1
Default

Quote:
Originally Posted by Eichhornchen View Post
Nothing worse than having a monster package and never using it.
Fnaar, fnaar.

__________________


Hanging on in quiet desperation is the English way...
Tango589 is offline   Reply With Quote
Old 10-28-14, 04:58 PM   #7
vienna
Navy Seal
 
Join Date: Jun 2005
Location: Anywhere but the here & now...
Posts: 7,720
Downloads: 85
Uploads: 0


Default

You know, when I saw the title of this thread, I was a bit confused. I live in Hollywood, California; here, a standard deviation is anything that does not require above normal medical attention, a lengthy session in a confessional, or an excessive bail...


<O>
__________________
__________________________________________________ __
vienna is offline   Reply With Quote
Old 10-28-14, 05:28 PM   #8
Chad
ACE
 
Join Date: Sep 2002
Location: Kansas City
Posts: 1,274
Downloads: 60
Uploads: 0
Default

I am a bit rusty on my C++, but maybe we can get you going in the right direction with some psuedo-code!

We know we will have a list of items with numeric values, for simplicity sake, let's assume these are doubles.

So, let's pass that to stubbed method:

Code:
public void CalculateStandardDev(double listOfDoubles)
{

}
Now, we know the length of our array using the following:

Code:
listOfDoubles.size();
This will be our 'n' variable

Code:
public void CalculateStandardDev(double listOfDoubles)
{
     int sizeOfList = listOfDoubles.size();
}
Now we can find the mean by adding an additional local parameter called temporarySum and adding to it while in scope. This may be where my C++ rusty-ness shows

Code:
public void CalculateStandardDev(double listOfDoubles)
{
     int sizeOfList = listOfDoubles.size();
     double temporarySum = 0;

     for(int i=0; i<sizeOfList; i++)
     {
         temporarySum += listOfDoubles[i];
     }
}
__________________
Chad is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:42 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.