help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: var(1) = 0 ??


From: c.
Subject: Re: var(1) = 0 ??
Date: Fri, 27 Jan 2012 23:32:22 +0100

On 27 Jan 2012, at 22:40, Muhali wrote:

> var(1) = 0 is at least in conflict with the standard definition of the
> unbiased estimate, where the sum of squared deviations is scaled by n-1 (n
> sample size).

but if all elements in the sample are equal, e.g.:

>> n = 100;
>> samp = ones (1, n);

then the mean value has that same value

>> mean (samp)
ans =  1

therefore all the squred deviations are 0:

>> mu = mean (samp);
>> any ((samp - mu).^2)
ans = 0

and the "standard definition of the unbiased estimate" still returns 0:

>> sum ((samp - mu).^2) / (n - 1)
ans = 0

why would you expect a different result?
c.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]