Log in

View Full Version : Standard Deviation. Explain.


Jeff-Groves
10-26-14, 07:03 PM
Talk amoungst yourselfs, peek at the other Guys paper, whatever.
:hmmm:

StdDev
10-26-14, 07:52 PM
The average amount by which a data point (ie score) deviates from the average of that same set of data points. :know:

or it could mean how twisted the average person actually is:k_confused:

Skybird
10-26-14, 08:14 PM
The average amount by which a data point (ie score) deviates from the average of that same set of data points. :know:

or it could mean how twisted the average person actually is:k_confused:
Or in other words: the amount of dispersion (Streuung) of scores from the expected value (Erwartungswert).

One of several additional descriptive values without which any expression of mean values (averages) usually makes little sense.

Started statistics courses?

vanjast
10-27-14, 01:49 AM
Grouping accuracy :03:

ikalugin
10-27-14, 01:51 AM
I remember when I was doing my physics lab work stuff and my values (with accounted observation error) did not fit the -true- values I should have been getting.

And then I have used Student's coefficient of 0.99 hehe.

Eichhörnchen
10-27-14, 02:21 AM
Or in other words: the amount of dispersion (Streuung) of scores from the expected value (Erwartungswert).

One of several additional descriptive values without which any expression of mean values (averages) usually makes little sense.

Started statistics courses?

That's easy for you to say; for me it means something quite different...

ikalugin
10-27-14, 02:23 AM
If you are doing it as a part of A-level math statistics course then just memorise the formula.

In layman terms (not a strict or even formally correct deffenition) - SD is how spread your values are, so the higher SD shows you a more chaotic rather than ordered spread of values.

Skybird
10-27-14, 06:15 AM
That's easy for you to say; for me it means something quite different...
Hm...?

Jimbuna
10-27-14, 07:07 AM
The position Todd took at the cafe that night in Houston when the weirdo asked him for a cigarette :)

Gargamel
10-27-14, 08:19 AM
The square of the variance :D


.... or is it square root?


In poker we used to call it a measure of short term luck.

Jeff-Groves
10-27-14, 08:38 AM
Started statistics courses?

Nope. Writing a program that captures data from a chronograph then calculates the SD and other stuff interesting to Air Gunners.
Found a simple example here:

http://www.mathsisfun.com/data/standard-deviation-formulas.html

The written formula may as well be Chinese to me.
:haha:

Sailor Steve
10-27-14, 09:08 AM
.... or is it square root?
Not a square knot?

The written formula may as well be Chinese to me.
:haha:
Ask Rhodes. It's all Greek to him. :O:

Chad
10-27-14, 10:32 AM
What language are you writing your application in? Some core languages may already have a function for calculating standard deviation in its Math library class.

If not, pending the language, I could try writing up a small method.

Eichhörnchen
10-27-14, 11:25 AM
this?http://i.imgur.com/L5DDmuT.jpg?1

Jeff-Groves
10-27-14, 02:13 PM
What language are you writing your application in? Some core languages may already have a function for calculating standard deviation in its Math library class.

If not, pending the language, I could try writing up a small method.

VS 2008 C++ is what I use.
It has no StDev function so I'll have to search out some code or do it myself.
I'm not big into adding other stuff like Boost etc.
FLTK 1.3.2 is all I have and that's for GUI work.

Aktungbby
10-27-14, 02:49 PM
^:sign_yeah::agree:http://www.mathsisfun.com/data/images/standard-deviation-sample.gif I see it so clearly now; Jeff! You've got it in a nutshell!:k_confused:I didn't know air guns were so complicated.:timeout:

ikalugin
10-27-14, 03:16 PM
Err you don't really need to create an object (class) for this, a simple function should do just fine.

Jeff-Groves
10-28-14, 09:38 AM
Yep. A new function is plenty good enuff. I don't like adding some monster package I'll never use.

Eichhörnchen
10-28-14, 09:47 AM
Nothing worse than having a monster package and never using it.

Pisces
10-28-14, 10:52 AM
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.

Tango589
10-28-14, 01:34 PM
Nothing worse than having a monster package and never using it.
Fnaar, fnaar.

http://i298.photobucket.com/albums/mm260/tango589/94941-monkey-sigh-rimshot-gif-drums-K5UJ.gif

vienna
10-28-14, 04:58 PM
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>

Chad
10-28-14, 05:28 PM
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:


public void CalculateStandardDev(double listOfDoubles)
{

}


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

listOfDoubles.size();

This will be our 'n' variable


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 :arrgh!:


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

for(int i=0; i<sizeOfList; i++)
{
temporarySum += listOfDoubles[i];
}
}

Chad
10-28-14, 05:39 PM
Sorry, was scared I was going to lose progress.. Anyways, now we have the sum of all of our items and our 'n' variable. But we still don't have the mean, or the average. So.. to find the average we divide the sum of all of our numbers by 'n', our size of our list:


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

for(int i=0; i<sizeOfList; i++)
{
temporarySum += listOfDoubles[i];
}

double averageOfList = temporarySum / sizeOfList;
}



:up: Done with Step 1!

So now we go into Step 2, which has this equation:

http://www.mathsisfun.com/data/images/standard-deviation-part1.gif

We look at each value and subtract the mean and square the result. Sounds easy enough:



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

for(int i=0; i<sizeOfList; i++)
{
temporarySum += listOfDoubles[i];
}

double averageOfList = temporarySum / sizeOfList;

for(int j=0; j<sizeOfList; j++)
{
listOfDoubles[j] = pow(listOfDoubles[j] - averageOfList, 2);
}
}


What I am doing is replacing the original value from the list with the calculated result of that value minus the average, and using the pow method to square the result. Square being to the second power.

pow(number, exponentValue)

Now we will loop through our list again and add the new listOfDoubles to eachother, or from 1 to N, N being our variable sizeOfList. We then need to divide by our size of list to give us, VARIANCE!


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

for(int i=0; i<sizeOfList; i++)
{
temporarySum += listOfDoubles[i];
}

double averageOfList = temporarySum / sizeOfList;

for(int j=0; j<sizeOfList; j++)
{
listOfDoubles[j] = pow(listOfDoubles[j] - averageOfList, 2);
}

double squaredDifference = 0;
double variance = 0;

for(int k=0; k<sizeOfList; k++)
{
squaredDifference += listOfDoubles[k];
}

variance = squaredDifference / sizeOfList;
}

Chad
10-28-14, 05:43 PM
Now that we have our variance, the last step is extremely easy. We simply take the square root of variance to give us the Standard Deviation value!!!


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

for(int i=0; i<sizeOfList; i++)
{
temporarySum += listOfDoubles[i];
}

double averageOfList = temporarySum / sizeOfList;

for(int j=0; j<sizeOfList; j++)
{
listOfDoubles[j] = pow(listOfDoubles[j] - averageOfList, 2);
}

double squaredDifference = 0;
double variance = 0;

for(int k=0; k<sizeOfList; k++)
{
squaredDifference += listOfDoubles[k];
}

variance = squaredDifference / sizeOfList;

double standardDeviationValue = sqrt (variance );
return standardDeviationValue;
}

Skybird
10-28-14, 05:52 PM
Brrr, take it away, it hurts our eyes! Last time I did stuff like that, was in GFA 3.0 on an Amiga, 25 years ago. :D

Jeff-Groves
10-29-14, 12:04 PM
I'm gonna go with C++ Mathematical Expression Toolkit Library (ExprTk).
It's a neat header file I can use then throw away along with those old Dewalt side cuts.
:D

Chad
10-29-14, 04:07 PM
I'm gonna go with C++ Mathematical Expression Toolkit Library (ExprTk).
It's a neat header file I can use then throw away along with those old Dewalt side cuts.
:D

Well it was fun going back and writing that method :)

Armistead
10-29-14, 05:16 PM
I had a deviated septum once.

Red October1984
10-29-14, 09:02 PM
Started statistics courses?

I've got this stuff in Psychology right now. It's in a chapter about mental retardation and how common and how severe it is.

Kaptlt.Endrass
10-30-14, 12:10 AM
You all got it wrong. Standard deviation is...

a) how far off you are from your target in darts.
b) how many drinks you've got left before you pass out.
c) how far the 'fire for effect' barrage is from hitting the obvious target.
d) completely irrevelant to anything we REALLY want to talk about (C'mon: Conversation about math or the next FIFA champs, which hopefully be Germany again)

Jeff-Groves
10-30-14, 02:18 PM
I hate math. I work with visual geometry mostly.
If I cut this post and let it fall will it miss all the stuff I don't want to break?
That kind of thing.
:O:

Imagine the surprise on faces the day I was not at work.
Some cables were cut that no one bothered to look at closely.
Results were a building that shifted and leaned 2" in a Northernly direction!

Eichhörnchen
10-30-14, 04:19 PM
The eyeball is a wonderful thing.:up: