Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Variance?
Date: Thu, 15 May 2008 21:24:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 35
Message-ID: <g0i9li$qum$1@fred.mathworks.com>
References: <g0i78i$ltc$1@news.net.uni-c.dk>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210886642 27606 172.30.248.35 (15 May 2008 21:24:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 May 2008 21:24:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:468708


"saneman" <asd@ad.com> wrote in message <g0i78i$ltc$1@news.net.uni-
c.dk>...
> I have a vector that contains:
> 
> v = 0.5677    0.4792    0.4844    0.4870    0.5104    0.4870    0.4792 
> 0.4974    0.4688    0.4870
> 
> Now I would like to know how much this data varies. I was thinking:
> 
> a = max(v) - min(v)
> 
> But if just one sample is very different (like 10.0) then the above 
> procedure will not give a realistic result.
> 
> I have also tried to use the matlab var function:
> 
> >> var(v)
> 
> ans =
> 
>   7.7977e-004
> 
> But 0.0007 is not where most of the data belongs. Is there better approach 
> to this problem? 
------------
  Remember, the 'var' function returns the mean of the *squares* of the 
differences between your numbers and their mean value.  Your differences 
from their mean are somewhere in the neighborhood of .03 so the mean 
square of these differences would be in the neighborhood of .0009.  (Actually 
you got .0008 .)  To get a value which is comparable to these differences, you 
should either call on 'std' or take the square root of the variance.

Roger Stafford