Talk:Cumulative standard deviation: Difference between revisions
Content added Content deleted
(→n is always >0: >1 really) |
|||
Line 3: | Line 3: | ||
: It won't hurt, and n is not always > 0. All the code I've done, and even the rest for what I can understand, provide a way of calculating standard deviation and mean, even if the first datum was not injected yet. A smart user won't call the method/function to get the mean if s/he's not put at least one value, but a dummy user could. In the OO cases, some methods shouldn't be public, and standard deviation could not be requested without adding a new value (very odd!), i.e. the only way to get stddev should be adding a new value... so that it would be a "know once and then forget" function/object. So to me it was "natural" to check for n>0, letting the user call mean, variance or whatever also if s/he's not added any value at all, without causing a division by zero problem. Of course for the task purpose it is not strictly necessary (real usability is not a requirement), nonetheless, it won't hurt and it assures that the behaviour is "good" for any input or misusage... --[[User:ShinTakezou|ShinTakezou]] 23:23, 16 June 2009 (UTC) |
: It won't hurt, and n is not always > 0. All the code I've done, and even the rest for what I can understand, provide a way of calculating standard deviation and mean, even if the first datum was not injected yet. A smart user won't call the method/function to get the mean if s/he's not put at least one value, but a dummy user could. In the OO cases, some methods shouldn't be public, and standard deviation could not be requested without adding a new value (very odd!), i.e. the only way to get stddev should be adding a new value... so that it would be a "know once and then forget" function/object. So to me it was "natural" to check for n>0, letting the user call mean, variance or whatever also if s/he's not added any value at all, without causing a division by zero problem. Of course for the task purpose it is not strictly necessary (real usability is not a requirement), nonetheless, it won't hurt and it assures that the behaviour is "good" for any input or misusage... --[[User:ShinTakezou|ShinTakezou]] 23:23, 16 June 2009 (UTC) |
||
:: I'm assured by my statistically-versed friends that the Standard Deviation isn't defined for <math>N<2</math> though it's convenient to define it to be <math>0</math> when <math>N=1</math> (i.e., it's trivial to get that from the mathematics if you're asking for the sample deviation, which is what this task is about). —[[User:Dkf|Donal Fellows]] 12:35, 17 June 2009 (UTC) |
:: I'm assured by my statistically-versed friends that the Standard Deviation isn't defined for <math>N<2</math> though it's convenient to define it to be <math>0</math> when <math>N=1</math> (i.e., it's trivial to get that from the mathematics if you're asking for the sample deviation, which is what this task is about). —[[User:Dkf|Donal Fellows]] 12:35, 17 June 2009 (UTC) |
||
::: Oh yes, it is so, but I was talking about values num/count can assume, not if the result is meaningful or not when they get that value. --[[User:ShinTakezou|ShinTakezou]] 12:54, 17 June 2009 (UTC) |
|||
==Function takes vector/array or single value?== |
==Function takes vector/array or single value?== |
Revision as of 12:54, 17 June 2009
n is always >0
But several examples check for n == 0
. I don't think it is necessary in this task (but won't hurt). --Paddy3118 22:06, 16 June 2009 (UTC)
- It won't hurt, and n is not always > 0. All the code I've done, and even the rest for what I can understand, provide a way of calculating standard deviation and mean, even if the first datum was not injected yet. A smart user won't call the method/function to get the mean if s/he's not put at least one value, but a dummy user could. In the OO cases, some methods shouldn't be public, and standard deviation could not be requested without adding a new value (very odd!), i.e. the only way to get stddev should be adding a new value... so that it would be a "know once and then forget" function/object. So to me it was "natural" to check for n>0, letting the user call mean, variance or whatever also if s/he's not added any value at all, without causing a division by zero problem. Of course for the task purpose it is not strictly necessary (real usability is not a requirement), nonetheless, it won't hurt and it assures that the behaviour is "good" for any input or misusage... --ShinTakezou 23:23, 16 June 2009 (UTC)
- I'm assured by my statistically-versed friends that the Standard Deviation isn't defined for Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N<2}
though it's convenient to define it to be Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 0}
when Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N=1}
(i.e., it's trivial to get that from the mathematics if you're asking for the sample deviation, which is what this task is about). —Donal Fellows 12:35, 17 June 2009 (UTC)
- Oh yes, it is so, but I was talking about values num/count can assume, not if the result is meaningful or not when they get that value. --ShinTakezou 12:54, 17 June 2009 (UTC)
- I'm assured by my statistically-versed friends that the Standard Deviation isn't defined for Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N<2}
though it's convenient to define it to be Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 0}
when Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N=1}
(i.e., it's trivial to get that from the mathematics if you're asking for the sample deviation, which is what this task is about). —Donal Fellows 12:35, 17 June 2009 (UTC)
Function takes vector/array or single value?
I took the task description to mean that the function should be called multiple times with a succession of values - hence the need of state between calls. Some think that the function should take an array of values. What to do? --Paddy3118 11:45, 17 June 2009 (UTC)
- The function should hold state between calls and take a single value at a time. Some people can't seem to resist implementing it wrongly. —Donal Fellows 12:31, 17 June 2009 (UTC)