Sample vs. Population Standard Deviation

Questions directed to our Support Team. Responses can be expected within 24 hours.

Sample vs. Population Standard Deviation

Postby mandelmus » Thu Sep 10, 2015 7:30 pm

I noticed that Stratasearch calculates the POPULATION standard deviation, by default. Would you consider adding the SAMPLE standard deviation as well? Since we are often only working with a limited subset of the data series, SAMPLE statistics may be more appropriate in those cases.

The new formulas could be:
sdevp() for population standard deviation ... stdev() would default to sdevp() to handle legacy code
sdevs() for sample standard deviation

In the meantime, the workaround would be to back-out and re-arrange the POPULATION standard deviation in order to obtain the SAMPLE standard deviation, like this:

> where N is the sample size
> replace "close" with any value of interest
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm

Re: Sample vs. Population Standard Deviation

Postby Overload » Fri Sep 11, 2015 8:36 am

You're right that sdev() calculates the Population standard deviation. But I might disagree with you that using Sample is the better choice.

When you create a 20-day standard deviation of the close prices, I believe you are actually trying to get the standard deviation of just those 20 days, and not using those 20 days as a sample toward obtaining the standard deviation of the entire price stream. If your goal is to obtain the standard deviation of just those 20 days, then you have the entire population and the Population standard deviation is the appropriate choice. If you had a sampling of only 15 of those 20 days, then the Sample standard deviation would be appropriate, but that isn't the case.

Still, I suppose there may be cases where a Sample standard deviation would be helpful, and your extraction of the Sample from the Population standard deviation works really well. In fact, I took it to the next step and created a Custom Formula named "sdevs" that looks like this:

Code: Select all
value = parameter("value");
days = parameter("days");
sdevs = sqrt((sqr(sdev(close,days))*days)/(days-1));

Here's an export file for it:
(331 Bytes) Downloaded 106 times

Just download the above file and import it through the File > Import Database menu. You'll then have access to a sdevs() formula that works just like sdev(), but assumes a Sample standard deviation instead of a Population.

Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Return to Technical Support