[Thread Prev][Thread Next][Index]

Re: [ferret_users] standard deviation



Hi,
  I think you are computing the standard deviation wrong.  Standard
deviation is the square root of the variance (average of the squared
differences between each data point and the mean of the data points).

your variable "tmaskI" is the mean, so I'm not sure what you did here.
Here is the way I would do it brute force...

let mean = data[x=@sum]/data[x=@ngd]
let sqr = (data - mean)^2
let stdv = (sqr[x=@sum/sqr[x=@ngd])^0.5


Steve

=======================================================
Stephen R. Guimond
Graduate Research Assistant
Center for Ocean-Atmospheric Prediction Studies (COAPS)
=======================================================

On Fri, 2 Nov 2007, Igaratza Fraile-Ugalde wrote:

> Hello ferret-ers
>
> Does anyone know how is the standard deviation computed in ferret?
> When I compute by my own does not coincide with the one given by ferret.
> Maximum, minimum and Mean values do, but no the standard deviation...
> The variable is called tmaskI, and is two dimensional
>
> yes? stat tmaskI
>
>  Total # of data points: 11400 (100*114*1*1)
>  # flagged as bad  data: 11328
>  Minimum value: -1.3267
>  Maximum value: 0.23136
>  Mean    value: -0.48291 (unweighted average)
>  Standard deviation: 0.39024
> yes? list tmaskI[x=@max,y=@max]
>
>           0.2314
> yes? list tmaskI[x=@min,y=@min]
>
>          -1.327
>
> yes? let N=72
> yes? list tmaskI[x=@sum,y=@sum]/N
>
>          -0.4829
>
> Until now everything coincides, but when I calculate the sd by my own:
>
> yes? let tmaskI2=tmaskI^2
> yes? let sd=(tmaskI2[x=@sum,y=@sum]/N)^0.5
> yes? list sd
>
>           0.6192
>
> I'm using the definition of standard deviation. What does ferret do
> different?
>
> Thanks!!
>
>
>




[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement