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
4
votes
2 answers

Calculate standard deviation of same text values in same column

I am trying to write a macro in Excel to calculate the standard deviation of same text in column A taking the values from column B and giving the results in column C: I did it manually by putting the equation=STDEV.S(A2;A3;A4;A16)for "aaa". But I…
Md. Abdur Rahim
  • 129
  • 1
  • 1
  • 10
4
votes
1 answer

Pandas Rolling Functions with Groupby

I am having a problem trying to implement the 'rolling' functions in Pandas (i.e. rolling_std() and rolling_corr()) when using the group by functions. I have tried using the below formulas but I keep getting 'ValueError: cannot reindex from a…
Gohawks
  • 1,044
  • 3
  • 12
  • 26
4
votes
1 answer

How to calculate how many standard deviations a number is from the mean?

I have a matrix of size (61964, 25). Here is a sample: array([[ 1., 0., 0., 4., 0., 1., 0., 0., 0., 0., 3., 0., 2., 1., 0., 0., 3., 0., 3., 0., 14., 0., 2., 0., 4.], [ 0., 0.,…
user706838
  • 5,132
  • 14
  • 54
  • 78
4
votes
6 answers

Computing Standard Deviation without packages in Python?

I'm trying to figure out how to create a script which calculates a standard deviation for a file. As an example, say I DLed a csv with a list of values on it. I want to find the SD of these values by running a python program. We are not using numpy…
whuan0319
  • 61
  • 1
  • 1
  • 5
4
votes
3 answers

means and SD for columns in a dataframe with NA values

I'm trying to calculate the mean and standard deviation of several columns (except the first column) in a data.frame with NA values. I've tried colMeans, sapply, etc., to create a loop that runs through the data.frame and then stores means and…
Anand Roopsind
  • 581
  • 2
  • 8
  • 11
4
votes
3 answers

How to calculate the standard deviation of subsets of data down a column in R

I would like to calculate the standard deviation of every 4 values down a column from the first to the last observation. I have found lots of answers for moving SD functions, but I simply need a line of code that will calculate the sd() for every 4…
Emily
  • 859
  • 5
  • 14
  • 31
4
votes
1 answer

Fast integer-only standard deviation?

Ages ago I had an extremely fast integer-only standard deviation function (in C) that would return values that were "reasonably" accurate using no division or multiplication, just shifts and adds. I have since lost that code, and Google has been…
BobC
  • 1,978
  • 3
  • 24
  • 26
4
votes
1 answer

Python Standard Deviation on a Deque

I am computing the simple moving average using the Python deque datatype, and I am wondering is there a way to have it treat this as some sort of an array and find the standard deviation of the deque?
eWizardII
  • 1,916
  • 4
  • 32
  • 55
4
votes
1 answer

How to get SAMPLE standard deviation with boost library?

Here is what I did : accumulator_set > accumulator; accumulator = for_each(x.begin(), x.end(), accumulator); double sDeviation = sqrt(variance(accumulator)); But the standard deviation returned is the population…
Gradient
  • 2,253
  • 6
  • 25
  • 36
4
votes
1 answer

Using BigQuery to find outliers with standard deviation results combined with WHERE clause

Standard deviation analysis can be a useful way to find outliers. Is there a way to incorporate the result of this query (finding the value of the fourth standard deviation away from the mean)... SELECT (AVG(weight_pounds) + STDDEV(weight_pounds) *…
Michael Manoochehri
  • 7,931
  • 6
  • 33
  • 47
3
votes
2 answers

How to do operations to a document other than the current one in MongoDB's setWindowFields

I have a MongoDB collection like this: [ { "_id": 1, "price": 1 }, { "_id": 2, "price": 2 }, { "_id": 3, "price": 3 }, { "_id": 4, "price": 4 }, { "_id": 5, "price": 5 }, { "_id": 6, …
AnujGeek
  • 130
  • 1
  • 8
3
votes
1 answer

Python Pandas calculate standard deviation excluding current group, with vectorization solution

So i want to calculate standard deviation excluding current group using groupby. Here an example of the data: import pandas as pd df = pd.DataFrame ({ 'group' : ['A','A','A','A','A','A','B','B','B','B','B','B'], …
nirina
  • 33
  • 2
3
votes
1 answer

Python Altair plot two standards of deviation

Is there a way to make a Python Altair plot showing two standards of deviation? Using mark_errorbar(extent='stdev') shows just one standard deviation. # Only shows one standard deviation. alt.Chart(data).mark_errorbar(extent='stdev').encode( …
Josh Grinberg
  • 523
  • 6
  • 14
3
votes
0 answers

Where did I go wrong in numpy normalization of input data in linear regression?

When following through Andrew Ng's Machine learning course assignment - Exercise:1 in python, I had to predict the prize of a house given the size of the house in sq-feet,number of bedroom using multi variable linear regression. In one of the steps…
3
votes
0 answers

Calculation of standard deviation in pyomo if variance is avaiable

I have constructed a pyomo code in which I calculate the weighted mean of 3 vectors as def meanX_definition(model, i): return m.meanX[i] ==(m.x1[i]+4*m.x2[i]+m.x3[i])/6 m.meanX_const = Constraint(m.N, rule = meanX_definition) And then, I have…
slow_learner
  • 337
  • 1
  • 2
  • 15