Warum verwenden wir eine voreingenommene und irreführende Standardabweichungsformel für


20

Es war ein kleiner Schock für mich, als ich zum ersten Mal eine Monte-Carlo-Normalverteilungssimulation durchführte und feststellte, dass der Mittelwert von 100 Standardabweichungen von 100 Stichproben, die alle nur eine Stichprobengröße von n=2 , viel geringer war als, dh Mittelung 2π mal dasσdas zur Erzeugung der Grundgesamtheit verwendet wird. Dies ist jedoch bekannt, wenn man sich nur selten daran erinnert, und ich wusste es irgendwie, oder ich hätte keine Simulation durchgeführt. Hier ist eine Simulation.

Hier ist ein Beispiel für die Vorhersage von 95% -Konfidenzintervallen von N(0,1) Verwendung von 100, n=2 , Schätzungen von SD und E(sn=2)=π2SD.

 RAND()   RAND()    Calc    Calc    
 N(0,1)   N(0,1)    SD      E(s)    
-1.1171  -0.0627    0.7455  0.9344  
 1.7278  -0.8016    1.7886  2.2417  
 1.3705  -1.3710    1.9385  2.4295  
 1.5648  -0.7156    1.6125  2.0209  
 1.2379   0.4896    0.5291  0.6632  
-1.8354   1.0531    2.0425  2.5599  
 1.0320  -0.3531    0.9794  1.2275  
 1.2021  -0.3631    1.1067  1.3871  
 1.3201  -1.1058    1.7154  2.1499  
-0.4946  -1.1428    0.4583  0.5744  
 0.9504  -1.0300    1.4003  1.7551  
-1.6001   0.5811    1.5423  1.9330  
-0.5153   0.8008    0.9306  1.1663  
-0.7106  -0.5577    0.1081  0.1354  
 0.1864   0.2581    0.0507  0.0635  
-0.8702  -0.1520    0.5078  0.6365  
-0.3862   0.4528    0.5933  0.7436  
-0.8531   0.1371    0.7002  0.8775  
-0.8786   0.2086    0.7687  0.9635  
 0.6431   0.7323    0.0631  0.0791  
 1.0368   0.3354    0.4959  0.6216  
-1.0619  -1.2663    0.1445  0.1811  
 0.0600  -0.2569    0.2241  0.2808  
-0.6840  -0.4787    0.1452  0.1820  
 0.2507   0.6593    0.2889  0.3620  
 0.1328  -0.1339    0.1886  0.2364  
-0.2118  -0.0100    0.1427  0.1788  
-0.7496  -1.1437    0.2786  0.3492  
 0.9017   0.0022    0.6361  0.7972  
 0.5560   0.8943    0.2393  0.2999  
-0.1483  -1.1324    0.6959  0.8721  
-1.3194  -0.3915    0.6562  0.8224  
-0.8098  -2.0478    0.8754  1.0971  
-0.3052  -1.1937    0.6282  0.7873  
 0.5170  -0.6323    0.8127  1.0186  
 0.6333  -1.3720    1.4180  1.7772  
-1.5503   0.7194    1.6049  2.0115  
 1.8986  -0.7427    1.8677  2.3408  
 2.3656  -0.3820    1.9428  2.4350  
-1.4987   0.4368    1.3686  1.7153  
-0.5064   1.3950    1.3444  1.6850  
 1.2508   0.6081    0.4545  0.5696  
-0.1696  -0.5459    0.2661  0.3335  
-0.3834  -0.8872    0.3562  0.4465  
 0.0300  -0.8531    0.6244  0.7826  
 0.4210   0.3356    0.0604  0.0757  
 0.0165   2.0690    1.4514  1.8190  
-0.2689   1.5595    1.2929  1.6204  
 1.3385   0.5087    0.5868  0.7354  
 1.1067   0.3987    0.5006  0.6275  
 2.0015  -0.6360    1.8650  2.3374  
-0.4504   0.6166    0.7545  0.9456  
 0.3197  -0.6227    0.6664  0.8352  
-1.2794  -0.9927    0.2027  0.2541  
 1.6603  -0.0543    1.2124  1.5195  
 0.9649  -1.2625    1.5750  1.9739  
-0.3380  -0.2459    0.0652  0.0817  
-0.8612   2.1456    2.1261  2.6647  
 0.4976  -1.0538    1.0970  1.3749  
-0.2007  -1.3870    0.8388  1.0513  
-0.9597   0.6327    1.1260  1.4112  
-2.6118  -0.1505    1.7404  2.1813  
 0.7155  -0.1909    0.6409  0.8033  
 0.0548  -0.2159    0.1914  0.2399  
-0.2775   0.4864    0.5402  0.6770  
-1.2364  -0.0736    0.8222  1.0305  
-0.8868  -0.6960    0.1349  0.1691  
 1.2804  -0.2276    1.0664  1.3365  
 0.5560  -0.9552    1.0686  1.3393  
 0.4643  -0.6173    0.7648  0.9585  
 0.4884  -0.6474    0.8031  1.0066  
 1.3860   0.5479    0.5926  0.7427  
-0.9313   0.5375    1.0386  1.3018  
-0.3466  -0.3809    0.0243  0.0304  
 0.7211  -0.1546    0.6192  0.7760  
-1.4551  -0.1350    0.9334  1.1699  
 0.0673   0.4291    0.2559  0.3207  
 0.3190  -0.1510    0.3323  0.4165  
-1.6514  -0.3824    0.8973  1.1246  
-1.0128  -1.5745    0.3972  0.4978  
-1.2337  -0.7164    0.3658  0.4585  
-1.7677  -1.9776    0.1484  0.1860  
-0.9519  -0.1155    0.5914  0.7412  
 1.1165  -0.6071    1.2188  1.5275  
-1.7772   0.7592    1.7935  2.2478  
 0.1343  -0.0458    0.1273  0.1596  
 0.2270   0.9698    0.5253  0.6583  
-0.1697  -0.5589    0.2752  0.3450  
 2.1011   0.2483    1.3101  1.6420  
-0.0374   0.2988    0.2377  0.2980  
-0.4209   0.5742    0.7037  0.8819  
 1.6728  -0.2046    1.3275  1.6638  
 1.4985  -1.6225    2.2069  2.7659  
 0.5342  -0.5074    0.7365  0.9231  
 0.7119   0.8128    0.0713  0.0894  
 1.0165  -1.2300    1.5885  1.9909  
-0.2646  -0.5301    0.1878  0.2353  
-1.1488  -0.2888    0.6081  0.7621  
-0.4225   0.8703    0.9141  1.1457  
 0.7990  -1.1515    1.3792  1.7286  

 0.0344  -0.1892    0.8188  1.0263  mean E(.)
                    SD pred E(s) pred   
-1.9600  -1.9600   -1.6049 -2.0114    2.5%  theor, est
 1.9600   1.9600    1.6049  2.0114   97.5%  theor, est
                    0.3551 -0.0515    2.5% err
                   -0.3551  0.0515   97.5% err

Ziehen Sie den Schieberegler nach unten, um die Gesamtsummen anzuzeigen. Jetzt habe ich den gewöhnlichen SD-Schätzer verwendet, um 95% -Konfidenzintervalle um einen Mittelwert von Null zu berechnen, und sie sind um 0,3551 Standardabweichungseinheiten versetzt. Der E (s) -Schätzer ist nur um 0,0515 Standardabweichungseinheiten versetzt. Wenn man die Standardabweichung, den Standardfehler des Mittelwerts oder die t-Statistik schätzt, kann ein Problem vorliegen.

Meine Argumentation lautete wie folgt: Das Populationsmittel μ zweier Werte kann in Bezug auf a überall sein x1und liegt definitiv nicht bei x1+x22 , was letztere für ein absolut minimales mögliches Quadrat sorgt, so dass wirσunterschätzenσ Wesentlichen wie folgt unterschätzen

WLOG lassen x2x1=d , dann Σi=1n(xix¯)2 ist 2(d2)2=d22 , das geringstmögliche Ergebnis.

Das heißt, die Standardabweichung berechnet sich zu

SD=Σi=1n(xix¯)2n1 ,

ist ein verzerrter Schätzer der Populationsstandardabweichung ( σ ). Beachten Sie , in dieser Formel verringern wir die Freiheitsgrade von n um 1 und durch Teilen n1 , also tun wir einige Korrekturen, aber es ist nur asymptotisch richtig ist , und n3/2 wäre eine bessere sein Daumenregel . Für unser Beispiel würde x2x1=ddie SD Formel SD=d20.707dein statistisch unplausibel Minimalwert alsμx¯, wo ein besseren Erwartungswert (s) wäreE(s)=π2d2=π2d0.886d. Für die übliche Berechnung fürn<10,SDleiden s von sehr bedeutenden Unterschätzung genanntkleine Zahl Bias, die nur 1% unterschätzt nähert sichσwennnetwa ist25. Da viele biologische Experimenten<25, ist dies in der Tat ein Problem. Fürn=1000beträgt der Fehler ungefähr 25 Teile in 100.000. Im Allgemeinenimpliziert dieBias-Korrektur für kleine Zahlen, dass der unverzerrte Schätzer der Populationsstandardabweichung einer Normalverteilung ist

E(s)=Γ(n12)Γ(n2)Σi=1n(xix¯)22>SD=Σi=1n(xix¯)2n1.

Aus Wikipedia unter Creative-Commons-Lizenzen hat man einen Plot der SD-Unterschätzung von σ <a title = "Von Rb88guy (Eigene Arbeit) [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0) oder GFDL (http://www.gnu.org/copyleft/fdl .html)], über Wikimedia Commons "href =" https://commons.wikimedia.org/wiki/File%3AStddevc4factor.jpg "> <img width =" 512 "alt =" Stddevc4factor "src =" https: // upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Stddevc4factor.jpg/512px-Stddevc4factor.jpg "/> </a>

Da SD ein verzerrter Schätzer für die Populationsstandardabweichung ist, kann es nicht der unverzerrte Schätzer für die minimale Varianz der Populationsstandardabweichung sein, es sei denn, wir sind mit der Aussage zufrieden, dass es MVUE als n , was ich nicht bin.

In Bezug auf Nicht-Normalverteilungen und etwa unvoreingenommene lesen diese .SD

Nun kommt die Frage Q1

Kann bewiesen werden, dass das obige MVUE für σ einer Normalverteilung der Stichprobengröße n ist , wobei n eine positive ganze Zahl größer als eins ist?E(s)σnn

Hinweis: (aber nicht die Antwort) siehe Wie kann ich die Standardabweichung der Stichprobenstandardabweichung von einer Normalverteilung ermitteln? .

Nächste Frage, Q2

Würde mir bitte jemand erklären, warum wir da es eindeutig voreingenommen und irreführend ist? Das heißt, warum nicht für fast alles E ( s ) verwenden ? SDE(s)Ergänzend ist in den folgenden Antworten klar geworden, dass die Varianz unvoreingenommen ist, ihre Quadratwurzel jedoch voreingenommen ist. Ich würde darum bitten, dass Antworten die Frage beantworten, wann eine unverzerrte Standardabweichung verwendet werden sollte.

Wie sich herausstellt, ist eine teilweise Antwort, dass, um Verzerrungen in der obigen Simulation zu vermeiden, die Varianzen statt der SD-Werte gemittelt worden sein könnten. Um zu sehen, wie sich dies auswirkt, erhalten wir, wenn wir die SD-Spalte oben quadrieren und diese Werte mitteln, 0,9994, dessen Quadratwurzel eine Schätzung der Standardabweichung 0,9996915 ist und dessen Fehler nur 0,0006 für die 2,5% -Schwanz und beträgt -0.0006 für den 95% Schwanz. Beachten Sie, dass dies darauf zurückzuführen ist, dass Varianzen additiv sind. Daher ist die Mittelwertbildung eine fehlerarme Prozedur. Standardabweichungen sind jedoch voreingenommen, und in den Fällen, in denen wir nicht den Luxus haben, Varianzen als Vermittler zu verwenden, müssen wir noch eine Korrektur kleinerer Zahlen vornehmen. Auch wenn wir die Varianz als Vermittler verwenden können, in diesem Fall für n=100Die Korrektur für kleine Stichproben schlägt vor, die Quadratwurzel der unverzerrten Varianz 0,9996915 mit 1,002528401 zu multiplizieren, um 1,002219148 als unverzerrte Schätzung der Standardabweichung zu erhalten. Also, ja, wir können die Korrektur kleiner Zahlen verzögern, aber sollten wir sie deshalb vollständig ignorieren?

Die Frage ist hier, wann wir eine Korrektur für kleine Zahlen verwenden sollten, anstatt ihre Verwendung zu ignorieren, und vor allem haben wir ihre Verwendung vermieden.

In einem anderen Beispiel beträgt die minimale Anzahl von Punkten im Raum, um einen linearen Trend mit einem Fehler zu erstellen, drei. Wenn wir diese Punkte mit gewöhnlichen kleinsten Quadraten anpassen, ist das Ergebnis für viele solcher Anpassungen ein gefaltetes normales Restmuster, wenn es eine Nichtlinearität gibt, und eine Halbnormale, wenn es eine Linearität gibt. Im Halbnormalfall erfordert unser Verteilungsmittel eine kleine Korrektur der Zahl. Wenn wir den gleichen Trick mit 4 oder mehr Punkten versuchen, ist die Verteilung im Allgemeinen nicht normal oder nicht einfach zu charakterisieren. Können wir Varianz verwenden, um diese 3-Punkte-Ergebnisse irgendwie zu kombinieren? Vielleicht vielleicht auch nicht. Probleme hinsichtlich Abständen und Vektoren sind jedoch leichter vorstellbar.


Kommentare sind nicht für eine längere Diskussion gedacht. Diese Unterhaltung wurde in den Chat verschoben .
whuber

3
Frage 1: Siehe den Satz von Lehmann-Scheffe.
Scortchi

1
Eine Nicht-Null-Verzerrung eines Schätzers ist nicht unbedingt ein Nachteil. Wenn wir zum Beispiel einen genauen Schätzer für den Quadratverlust haben möchten, sind wir bereit, eine Verzerrung zu induzieren, solange dies die Varianz um einen ausreichend großen Betrag verringert. Aus diesem Grund können (voreingenommene) regulierte Schätzer beispielsweise in einem linearen Regressionsmodell eine bessere Leistung erzielen als der (unvoreingenommene) OLS-Schätzer.
Richard Hardy

3
@Carl Viele Begriffe werden in verschiedenen Anwendungsbereichen unterschiedlich verwendet. Wenn Sie in einer Statistikgruppe posten und einen Jargonbegriff wie "Bias" verwenden, wird natürlich davon ausgegangen, dass Sie die spezifische Bedeutung (en) des statistischen Begriffs verwenden. Wenn Sie etwas anderes meinen , ist es wichtig, entweder einen anderen Begriff zu verwenden oder klar zu definieren, was Sie beim ersten Gebrauch unter dem Begriff verstehen.
Glen_b

2
"Voreingenommenheit" ist zweifellos ein Begriff des Jargons - spezielle Wörter oder Ausdrücke, die von einem Beruf oder einer Gruppe verwendet werden und die für andere schwer zu verstehen sind, scheinen ziemlich genau das zu sein, was "Voreingenommenheit" ist. Solche Begriffe haben präzise, ​​spezialisierte Definitionen in ihren Anwendungsbereichen (einschließlich mathematischer Definitionen), die sie zu Jargon-Begriffen machen.
Glen_b

Antworten:


34

Für die eingeschränktere Frage

Warum wird normalerweise eine voreingenommene Standardabweichungsformel verwendet?

die einfache antwort

Weil der zugehörige Varianzschätzer unvoreingenommen ist. Es gibt keine wirkliche mathematisch / statistische Rechtfertigung.

kann in vielen Fällen genau sein.

Dies muss jedoch nicht immer der Fall sein. Es gibt mindestens zwei wichtige Aspekte dieser Themen, die verstanden werden sollten.

Erstens ist die Stichprobenvarianz nicht nur für Gaußsche Zufallsvariablen unverzerrt. Es ist unbefangen für jede Verteilung mit endlicher Varianz σ 2 (wie unten in meiner ursprünglichen Antwort diskutiert). Die Frage stellt fest, dass s für σ nicht unverzerrt ist , und schlägt eine Alternative vor, die für eine Gaußsche Zufallsvariable unverzerrt ist. Es ist jedoch wichtig zu beachten, dass es im Gegensatz zur Varianz für die Standardabweichung nicht möglich ist, einen "verteilungsfreien" unverzerrten Schätzer zu haben (* siehe Hinweis unten).s2σ2sσ

Zweitens hat, wie in dem Kommentar von whuber erwähnt, die Tatsache, dass voreingenommen ist, keinen Einfluss auf den Standard "t-Test". Beachten Sie zunächst, dass für eine Gaußsche Variable x , wenn wir z-Scores aus einer Stichprobe { x i } als z i = x i - μ schätzensx{xi} dann werden diese voreingenommen sein.

zi=xiμσxix¯s

Die t-Statistik wird jedoch normalerweise im Zusammenhang mit der Stichprobenverteilung von . In diesem Fall wäre der z-Score z ˉ x = ˉ x - μx¯

zx¯=x¯μσx¯x¯μs/n=t
though we can compute neither z nor t, as we do not know μ. Nonetheless, if the zx¯ statistic would be normal, then the t statistic will follow a Student-t distribution. This is not a large-n approximation. The only assumption is that the x samples are i.i.d. Gaussian.

(Commonly the t-test is applied more broadly for possibly non-Gaussian x. This does rely on large-n, which by the central limit theorem ensures that x¯ will still be Gaussian.)


*Clarification on "distribution-free unbiased estimator"

By "distribution free", I mean that the estimator cannot depend on any information about the population x aside from the sample {x1,,xn}. By "unbiased" I mean that the expected error E[θ^n]θ is uniformly zero, independent of the sample size n. (As opposed to an estimator that is merely asymptotically unbiased, a.k.a. "consistent", for which the bias vanishes as n.)

σ^=f[s,n,κx], where κx is the excess kurtosis of x. This estimator is not "distribution free", as κx depends on the distribution of x. The estimator is said to satisfy E[σ^]σx=O[1n], where σx2 is the variance of x. Hence the estimator is consistent, but not (absolutely) "unbiased", as O[1n] can be arbitrarily large for small n.


Note: Below is my original "answer". From here on, the comments are about the standard "sample" mean and variance, which are "distribution-free" unbiased estimators (i.e. the population is not assumed to be Gaussian).

This is not a complete answer, but rather a clarification on why the sample variance formula is commonly used.

{x1,,xn}, so long as the variables have a common mean, the estimator x¯=1nixi will be unbiased, i.e.

E[xi]=μE[x¯]=μ

If the variables also have a common finite variance, and they are uncorrelated, then the estimator s2=1n1i(xix¯)2 will also be unbiased, i.e.

E[xixj]μ2={σ2i=j0ijE[s2]=σ2
Note that the unbiasedness of these estimators depends only on the above assumptions (and the linearity of expectation; the proof is just algebra). The result does not depend on any particular distribution, such as Gaussian. The variables xi do not have to have a common distribution, and they do not even have to be independent (i.e. the sample does not have to be i.i.d.).

The "sample standard deviation" s is not an unbiased estimator, sσ, but nonetheless it is commonly used. My guess is that this is simply because it is the square root of the unbiased sample variance. (With no more sophisticated justification.)

In the case of an i.i.d. Gaussian sample, the maximum likelihood estimates (MLE) of the parameters are μ^MLE=x¯ and (σ^2)MLE=n1ns2, i.e. the variance divides by n rather than n2. Moreover, in the i.i.d. Gaussian case the standard deviation MLE is just the square root of the MLE variance. However these formulas, as well as the one hinted at in your question, depend on the Gaussian i.i.d. assumption.


Update: Additional clarification on "biased" vs. "unbiased".

Consider an n-element sample as above, X={x1,,xn}, with sum-square-deviation

δn2=i(xix¯)2
Given the assumptions outlined in the first part above, we necessarily have
E[δn2]=(n1)σ2
so the (Gaussian-)MLE estimator is biased
σn2^=1nδn2E[σn2^]=n1nσ2
while the "sample variance" estimator is unbiased
sn2=1n1δn2E[sn2]=σ2

Now it is true that σn2^ becomes less biased as the sample size n increases. However sn2 has zero bias no matter the sample size (so long as n>1). For both estimators, the variance of their sampling distribution will be non-zero, and depend on n.

As an example, the below Matlab code considers an experiment with n=2 samples from a standard-normal population z. To estimate the sampling distributions for x¯,σ2^,s2, the experiment is repeated N=106 times. (You can cut & paste the code here to try it out yourself.)

% n=sample size, N=number of samples
n=2; N=1e6;
% generate standard-normal random #'s
z=randn(n,N); % i.e. mu=0, sigma=1
% compute sample stats (Gaussian MLE)
zbar=sum(z)/n; zvar_mle=sum((z-zbar).^2)/n;
% compute ensemble stats (sampling-pdf means)
zbar_avg=sum(zbar)/N, zvar_mle_avg=sum(zvar_mle)/N
% compute unbiased variance
zvar_avg=zvar_mle_avg*n/(n-1)

Typical output is like

zbar_avg     =  1.4442e-04
zvar_mle_avg =  0.49988
zvar_avg     =  0.99977

confirming that

E[z¯](z¯)¯μ=0E[s2](s2)¯σ2=1E[σ2^](σ2^)¯n1nσ2=12

Update 2: Note on fundamentally "algebraic" nature of unbiased-ness.

In the above numerical demonstration, the code approximates the true expectation E[] using an ensemble average with N=106 replications of the experiment (i.e. each is a sample of size n=2). Even with this large number, the typical results quoted above are far from exact.

To numerically demonstrate that the estimators are really unbiased, we can use a simple trick to approximate the N case: simply add the following line to the code

% optional: "whiten" data (ensure exact ensemble stats)
[U,S,V]=svd(z-mean(z,2),'econ'); z=sqrt(N)*U*V';

(placing after "generate standard-normal random #'s" and before "compute sample stats")

With this simple change, even running the code with N=10 gives results like

zbar_avg     =  1.1102e-17
zvar_mle_avg =  0.50000
zvar_avg     =  1.00000

3
@amoeba Well, I'll eat my hat. I squared the SD-values in each line then averaged them and they come out unbiased (0.9994), whereas the SD-values themselves do not. Meaning that you and GeoMatt22 are correct, and I am wrong.
Carl

2
@Carl: It's generally true that transforming an unbiased estimator of a parameter doesn't give an unbiased estimate of the transformed parameter except when the transformation is affine, following from the linearity of expectation. So on what scale is unbiasedness important to you?
Scortchi - Reinstate Monica

4
Carl: I apologize if you feel my answer was orthogonal to your question. It was intended to provide a plausible explanation of Q:"why a biased standard deviation formula is typically used?" A:"simply because the associated variance estimator is unbiased, vs. any real mathematical/statistical justification". As for your comment, typically "unbiased" describes an estimator whose expected value is correct independent of sample size. If it is unbiased only in the limit of infinite sample size, typically it would be called "consistent".
GeoMatt22

3
(+1) Nice answer. Small caveat: That Wikipedia passage on consistency quoted in this answer is a bit of a mess and the parenthetical statement made related to it is potentially misleading. "Consistency" and "asymptotic unbiasedness" are in some sense orthogonal properties of an estimator. For a little more on that point, see the comment thread to this answer.
cardinal

3
+1 but I think @Scortchi makes a really important point in his answer that is not mentioned in yours: namely, that even for Gaussian population, the unbiased estimate of σ has higher expected error than the standard biased estimate of σ (due to the high variance of the former). This is a strong argument in favour of not using an unbiased estimator even if one knows that the underlying distribution is Gaussian.
amoeba says Reinstate Monica

15

The sample standard deviation S=(XX¯)2n1 is complete and sufficient for σ so the set of unbiased estimators of σk given by

(n1)k22k2Γ(n12)Γ(n+k12)Sk=Skck

(See Why is sample standard deviation a biased estimator of σ?) are, by the Lehmann–Scheffé theorem, UMVUE. Consistent, though biased, estimators of σk can also be formed as

σ~jk=(Sjcj)kj

(the unbiased estimators being specified when j=k). The bias of each is given by

Eσ~jkσk=(ckcjkj1)σk

& its variance by

Varσ~jk=Eσ~j2k(Eσ~jk)2=c2kck2cj2kjσ2k

For the two estimators of σ you've considered, σ~11=Sc1 & σ~21=S, the lack of bias of σ~1 is more than offset by its larger variance when compared to σ~2:

Eσ~1σ=0Eσ~2σ=(c11)σVarσ~1=Eσ~12(Eσ~11)2=c2c12c12σ2=(1c121)σ2Varσ~2=Eσ~12(Eσ~2)2=c2c12c2σ2=(1c12)σ2
(Note that c2=1, as S2 is already an unbiased estimator of σ2.)

Plot showing contributions of bias & variance to MSE at sample sizes from one to 20 for the two estimators

The mean square error of akSk as an estimator of σ2 is given by

(EakSkσk)2+E(akSk)2(EakSk)2=[(akck1)2+ak2c2kak2ck2]σ2k=(ak2c2k2akck+1)σ2k

& therefore minimized when

ak=ckc2k

, allowing the definition of another set of estimators of potential interest:

σ^jk=(cjSjc2j)kj

Curiously, σ^11=c1S, so the same constant that divides S to remove bias multiplies S to reduce MSE. Anyway, these are the uniformly minimum variance location-invariant & scale-equivariant estimators of σk (you don't want your estimate to change at all if you measure in kelvins rather than degrees Celsius, & you want it to change by a factor of (95)k if you measure in Fahrenheit).

None of the above has any bearing on the construction of hypothesis tests or confidence intervals (see e.g. Why does this excerpt say that unbiased estimation of standard deviation usually isn't relevant?). And σ~jk & σ^jk exhaust neither estimators nor parameter scales of potential interest—consider the maximum-likelihood estimator n1nS, or the median-unbiased estimator n1χn12(0.5)S; or the geometric standard deviation of a lognormal distribution eσ. It may be worth showing a few more-or-less popular estimates made from a small sample (n=2) together with the upper & lower bounds, (n1)s2χn12(α) & (n1)s2χn12(1α), of the equal-tailed confidence interval having coverage 1α:

confidence distribution for $\sigma$ showing estimates

The span between the most divergent estimates is negligible in comparison with the width of any confidence interval having decent coverage. (The 95% C.I., for instance, is (0.45s,31.9s).) There's no sense in being finicky about the properties of a point estimator unless you're prepared to be fairly explicit about what you want you want to use it for—most explicitly you can define a custom loss function for a particular application. A reason you might prefer an exactly (or almost) unbiased estimator is that you're going to use it in subsequent calculations during which you don't want bias to accumulate: your illustration of averaging biased estimates of standard deviation is a simple example of such (a more complex example might be using them as a response in a linear regression). In principle an all-encompassing model should obviate the need for unbiased estimates as an intermediate step, but might be considerably more tricky to specify & fit.

† The value of σ that makes the observed data most probable has an appeal as an estimate independent of consideration of its sampling distribution.


7

Q2: Would someone please explain to me why we are using SD anyway as it is clearly biased and misleading?

This came up as an aside in comments, but I think it bears repeating because it's the crux of the answer:

The sample variance formula is unbiased, and variances are additive. So if you expect to do any (affine) transformations, this is a serious statistical reason why you should insist on a "nice" variance estimator over a "nice" SD estimator.

In an ideal world, they'd be equivalent. But that's not true in this universe. You have to choose one, so you might as well choose the one that lets you combine information down the road.

Comparing two sample means? The variance of their difference is sum of their variances.
Doing a linear contrast with several terms? Get its variance by taking a linear combination of their variances.
Looking at regression line fits? Get their variance using the variance-covariance matrix of your estimated beta coefficients.
Using F-tests, or t-tests, or t-based confidence intervals? The F-test calls for variances directly; and the t-test is exactly equivalent to the square root of an F-test.

In each of these common scenarios, if you start with unbiased variances, you'll remain unbiased all the way (unless your final step converts to SDs for reporting).
Meanwhile, if you'd started with unbiased SDs, neither your intermediate steps nor the final outcome would be unbiased anyway.


Variance is not a distance measurement, and standard deviation is. Yes, vector distances add by squares, but the primary measurement is distance. The question was what would you use corrected distance for, and not why should we ignore distance as if it did not exist.
Carl

Well, I guess I'm arguing that "the primary measurement is distance" isn't necessarily true. 1) Do you have a method to work with unbiased variances; combine them; take the final resulting variance; and rescale its sqrt to get an unbiased SD? Great, then do that. If not... 2) What are you going to do with a SD from a tiny sample? Report it on its own? Better to just plot the datapoints directly, not summarize their spread. And how will people interpret it, other than as an input to SEs and thus CIs? It's meaningful as an input to CIs, but then I'd prefer the t-based CI (with usual SD).
civilstat

I do no think that many clinical studies or commercial software programs with n<25 would use standard error of the mean calculated from small sample corrected standard deviation leading to a false impression of how small those errors are. I think even that one issue, even if that is the only one, should be ignored.
Carl

"so you might as well choose the one that lets you combine information down the road" and "the primary measurement is distance" isn't necessarily true. Farmer Jo's house is 640 acres down the road? One uses the appropriate measurement correctly for each and every situation, or one has a higher tolerance for false witness than I. My only question here is when to use what, and the answer to it is not "never."
Carl

1

This post is in outline form.

(1) Taking a square root is not an affine transformation (Credit @Scortchi.)

(2) var(s)=E(s2)E(s)2, thus E(s)=E(s2)var(s)var(s)

(3) var(s)=Σi=1n(xix¯)2n1, whereas E(s)=Γ(n12)Γ(n2)Σi=1n(xix¯)22Σi=1n(xix¯)2n1=var(s)

(4) Thus, we cannot substitute var(s) for E(s), for n small, as square root is not affine.

(5) var(s) and E(s) are unbiased (Credit @GeoMatt22 and @Macro, respectively).

(6) For non-normal distributions x¯ is sometimes (a) undefined (e.g., Cauchy, Pareto with small α) and (b) not UMVUE (e.g., Cauchy ( Student's-t with df=1), Pareto, Uniform, beta). Even more commonly, variance may be undefined, e.g. Student's-t with 1df2. Then one can state that var(s) is not UMVUE for the general case distribution. Thus, there is then no special onus to introducing an approximate small number correction for standard deviation, which likely has similar limitations to var(s), but is additionally less biased, σ^=1n1.514γ2i=1n(xix¯)2 ,

where γ2 is excess kurtosis. In a similar vein, when examining a normal squared distribution (a Chi-squared with df=1 transform), we might be tempted to take its square root and use the resulting normal distribution properties. That is, in general, the normal distribution can result from transformations of other distributions and it may be expedient to examine the properties of that normal distribution such that the limitation of small number correction to the normal case is not so severe a restriction as one might at first assume.

For the normal distribution case:

A1: By Lehmann-Scheffe theorem var(s) and E(s) are UMVUE (Credit @Scortchi).

A2: (Edited to adjust for comments below.) For n25, we should use E(s) for standard deviation, standard error, confidence intervals of the mean and of the distribution, and optionally for z-statistics. For t-testing we would not use the unbiased estimator as X¯μvar(n)/n itself is Student's-t distributed with n1 degrees of freedom (Credit @whuber and @GeoMatt22). For z-statistics, σ is usually approximated using n large for which E(s)var(n) is small, but for which E(s) appears to be more mathematically appropriate (Credit @whuber and @GeoMatt22).


2
A2 is incorrect: following that prescription would produce demonstrably invalid tests. As I commented to the question, perhaps too subtly: consult any theoretical account of a classical test, such as the t-test, to see why a bias correction is irrelevant.
whuber

2
There's a strong meta-argument showing why bias correction for statistical tests is a red herring: if it were incorrect not to include a bias-correction factor, then that factor would already be included in standard tables of the Student t distribution, F distribution, etc. To put it another way: if I'm wrong about this, then everybody has been wrong about statistical testing for the last century.
whuber

1
Am I the only one who's baffled by the notation here? Why use E(s) to stand for Γ(n12)Γ(n2)Σi=1n(xix¯)22, the unbiased estimate of standard deviation? What's s?
Scortchi - Reinstate Monica

2
@Scortchi the notation apparently came about as an attempt to inherit that used in the linked post. There s is the sample variance, and E(s) is the expected value of s for a Gaussian sample. In this question, "E(s)" was co-opted to be a new estimator derived from the original post (i.e. something like σ^s/α where αE[s]/σ). If we arrive at a satisfactory answer for this question, probably a cleanup of the question & answer notation would be warranted :)
GeoMatt22

2
The z-test assumes the denominator is an accurate estimate of σ. It's known to be an approximation that is only asymptotically correct. If you want to correct it, don't use the bias of the SD estimator--just use a t-test. That's what the t-test was invented for.
whuber

0

I want to add the Bayesian answer to this discussion. Just because your assumption is that the data is generated according to some normal with unknown mean and variance, that doesn't mean that you should summarize your data using a mean and a variance. This whole problem can be avoided if you draw the model, which will have a posterior predictive that is a three parameter noncentral scaled student's T distribution. The three parameters are the total of the samples, total of the squared samples, and the number of samples. (Or any bijective map of these.)

Incidentally, I like civilstat's answer because it highlights our desire to combine information. The three sufficient statistics above are even better than the two given in the question (or by civilstat's answer). Two sets of these statistics can easily be combined, and they give the best posterior predictive given the assumption of normality.


How then does one calculate an unbiased standard error of the mean from those three sufficient statistics?
Carl

@carl You can easily calculate it since you have the number of samples n, you can multiply the uncorrected sample variance by nn1. However, you really don't want to do that. That's tantamount to turning your three parameters into a best fit normal distribution to your limited data. It's a lot better to use your three parameters to fit the true posterior predictive: the noncentral scaled T distribution. All questions you might have (percentiles, etc.) are better answered by this T distribution. In fact, T tests are just common sense questions asked of this distribution.
Neil G

How can one then generate a true normal distribution RV from Monte Carlo simulations(s) and recover that true distribution using only Student's-t distribution parameters? Am I missing something here?
Carl

@Carl The sufficient statistics I described were the mean, second moment, and number of samples. Your MLE of the original normal are the mean and variance (which is equal to the second moment minus the squared mean). The number of samples is useful when you want to make predictions about future observations (for which you need the posterior predictive distribution).
Neil G

Though a Bayesian perspective is a welcome addition, I find this a little hard to follow: I'd have expected a discussion of constructing a point estimate from the posterior density of σ. It seems you're rather questioning the need for a point estimate: this is something well worth bringing up, but not uniquely Bayesian. (BTW you also need to explain the priors.)
Scortchi - Reinstate Monica
Durch die Nutzung unserer Website bestätigen Sie, dass Sie unsere Cookie-Richtlinie und Datenschutzrichtlinie gelesen und verstanden haben.
Licensed under cc by-sa 3.0 with attribution required.