standard deviation

Charles Seman Charles.Seman at NOAA.GOV
Thu May 11 17:04:25 EDT 2006


Loic,

Here is an example of the output from "set gxout stat" in GrADS:
---
Data Type = grid
Dimensions = 0 -1
I Dimension = 1 to 500 Linear 0 0.1
J Dimension = -999 to -999
Sizes = 500 1 500
Undef value = -9999.9
Undef count = 0  Valid count = 500
Min, Max = 0 82128
Cmin, cmax, cint = -20000 100000 10000
Stats[sum,sumsqr,root(sumsqr),n]:     673320 2.77471e+10 166575 500
Stats[(sum,sumsqr,root(sumsqr))/n]:     1346.64 5.54941e+07 7449.44
Stats[(sum,sumsqr,root(sumsqr))/(n-1)]: 1349.34 5.56054e+07 7456.9
Stats[(sigma,var)(n)]:     7326.71 5.36807e+07
Stats[(sigma,var)(n-1)]:   7334.05 5.37883e+07
---

I think "(sigma,var)(n-1)" are the sample standard deviation and
variance (which use "n-1" points)...
(for a reference for the definitions of the sample standard deviation
and variance, see for example "Statistical Concepts and Methods" by
Bhattacharyya and Johnson (1977), page 34 for the sample variance, and
page 35 for the sample standard deviation)

In a GrADS script, to get the numerical values of
"Stats[(sigma,var)(n-1)]:   7334.05 5.37883e+07", try:

...set x, y, z, t grid dimensions here...
'set gxout stat'
'd somevar'
rec14 = sublin(result,14)
sigma_nm1 = subwrd(rec14,2)
var_nm1 = subwrd(rec14,3)
say 'sigma_nm1 = 'sigma_nm1
say 'var_nm1 = 'var_nm1

I hope this helps,
Chuck

Cottet, Loic (IFPRI) wrote:

>Hi all,
>
>Could everyone tell me if there is a function to calcualte the standard
>deviation with Grads,
>
>Thanks
>
>

--

********************************************************************
 Charles Seman                                charles.seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."



More information about the gradsusr mailing list