Questions tagged [standard-deviation]

Standard deviation (represented by the symbol sigma, σ) shows how much variation or "dispersion" exists from the average (mean, or expected value).

The standard deviation of a random variable, statistical population, data set, or probability distribution is the square root of its . A standard deviation close to 0 indicates that the data points tend to be very close to the mean (also called the expected value) of the set, while a high standard deviation indicates that the data points are spread out over a wider range of values.

The standard deviation of X is the quantity

enter image description here

870 questions
20
votes
5 answers

z-Scores(standard deviation and mean) in PHP

I am trying to calculate Z-scores using PHP. Essentially, I am looking for the most efficient way to calculate the mean and standard deviation of a data set (PHP array). Any suggestions on how to do this in PHP? I am trying to do this in the…
Spencer
  • 21,348
  • 34
  • 85
  • 121
20
votes
2 answers

OpenCV Mean/SD filter

I'm throwing this out there in hope that someone will have attempted something this ridiculous before. My goal is to take in an input image, and segment it based upon the standard deviation of a small window around each pixel. Bascially, this should…
gankoji
  • 853
  • 1
  • 10
  • 23
18
votes
1 answer

Using standard deviations in GenMatch to encourage more pairs

So following the example from the Matching package and in particular the GenMatch example. This continues on from a previous question Link to R package here Following the example in GenMatch library(Matching) data(lalonde) attach(lalonde) X =…
lukeg
  • 1,327
  • 3
  • 10
  • 27
17
votes
1 answer

Pandas rolling standard deviation

Is anyone else having trouble with the new rolling.std() in pandas? The deprecated method was rolling_std(). The new method runs fine but produces a constant number that does not roll with the time series. Sample code is below. If you trade…
Mark
  • 1,079
  • 1
  • 9
  • 8
17
votes
1 answer

GSL statistics, what is stride?

I would like to use GSL (Gnu Scientific Lib) to calculate the standard deviation of an array. http://www.gnu.org/software/gsl/manual/html_node/Mean-and-standard-deviation-and-variance.html In the manual, the function prototype is gsl_stats_sd (const…
Alfred Zhong
  • 6,773
  • 11
  • 47
  • 59
16
votes
3 answers

Ellipse around the data in MATLAB

I would like to reproduce the following figure in MATLAB: There are two classes of points with X and Y coordinates. I'd like to surround each class with an ellipse with one parameter of standard deviation, which determine how far the ellipse will…
yuk
  • 19,098
  • 13
  • 68
  • 99
16
votes
8 answers

Calculating Standard Deviation & Variance in C++

So, I've posted a few times and previously my problems were pretty vague. I started C++ this week and have been doing a little project. I'm trying to calculate standard deviation & variance. My code loads a file of 100 integers and puts them into an…
Jack
  • 321
  • 2
  • 5
  • 16
15
votes
2 answers

Calculate the 3rd standard deviation for an array

Say, I have an array: import numpy as np x = np.array([0, 1, 2, 5, 6, 7, 8, 8, 8, 10, 29, 32, 45]) How can I calculate the 3rd standard deviation for it, so I could get the value of +3sigma as shown on the picture below? Typically, I use std =…
bluevoxel
  • 4,978
  • 11
  • 45
  • 63
14
votes
1 answer

haskell - Average floating point error using QuickCheck

I am using QuickCheck-2.5.1.1 to do QA. I am testing two pure functions gold :: a -> Float and f :: a -> Float, where a instances Arbitrary. Here gold is a reference calculation and f is a variation I am optimizing. To date, most of my tests using…
Matt W-D
  • 1,605
  • 2
  • 19
  • 22
13
votes
3 answers

Function that converts a vector of numbers to a vector of standard units

Is there a function that given a vector of numbers, returns another vector with the standard units corresponding to each value? where standard unit: how many SDs a value is + or - from the mean Example: x <- c(1,3,4,5,7) # note: mean = 4, sd =…
jd.
  • 4,543
  • 7
  • 34
  • 40
12
votes
2 answers

Java Streams - Standard Deviation

I wish to clarify upfront I am looking for a way to calculate Standard deviation using Streams (I have a working method at present which calculates & returns SD but without using Streams). The dataset i am working with matches closely as seen in…
iCoder
  • 1,406
  • 6
  • 16
  • 35
12
votes
2 answers

how can I choose a random number but with a normal probability distribution in PHP?

In php, how can I generate a a random number assuming a normal distribution with a specific mean and standard devaition?
Maggie
  • 357
  • 4
  • 11
12
votes
5 answers

standard deviation of an arbitrary number of numbers using bc or other standard utilities

Is there some trick that would allow one to use bc (or some other standard utility) to return the standard deviation of an arbitrary number of numbers? For convenience, let's say that the numbers are stored in a Bash variable in the following…
d3pd
  • 7,935
  • 24
  • 76
  • 127
11
votes
4 answers

How to find cumulative variance or standard deviation in R

I have a column X in a data frame, for which I need to find the cumulative standard deviation. X Cumulative.SD 1 - 4 2.12 5 2.08 6 2.16 9 2.91
Praveen Chougale
  • 373
  • 3
  • 11
10
votes
2 answers

Finding mean and standard deviation across image channels PyTorch

Say I have a batch of images in the form of tensors with dimensions (B x C x W x H) where B is the batch size, C is the number of channels in the image, and W and H are the width and height of the image respectively. I'm looking to use the…
ch1maera
  • 1,369
  • 5
  • 20
  • 42
1
2
3
57 58