[ncl-talk] Effective Degree of Freedom

Dennis Shea shea at ucar.edu
Thu Dec 3 09:44:35 MST 2020

```I believe you have asked this question before.

****ncl-talk is not a statistics forum. ****
* ***Please talk to a statistician****

====
(1) Possibly:
You could use *esacr*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/esacr.shtml> or
*esacr_n*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/esacr_n.shtml>
(esacr_n is available in NCL 6.5.0 and later) on the filtered series to get
the lag_1 autocorrelation coefficients.

r_sst   = esacr(sst,1)
r1_sst = r_sst(1)              ; scalar; r1_sst(1)
r1_sst at long_name = "Lag-1 autocorrelation: sst
print(r1_sst)
; pre(lat,lon,time)  ... time is
rightmost dimension
r_pre  = esacr(pre,1)       ; r_pre(2,lat,lon,time)
r1_pre = r_pre(1,:,:)        ; r1_pre(nlat,mlom)
r1_pre at long_name = "Lag-1 autocorrelation: pre"
printVarSummary(r1_pre)
printMinMax(r1_pre)

r1_sst *:=* conform(r1_pre, r1_sst, -1)   ; := overwrite
printVarSummary(r1_sst)                 ; (nlat,mlon)

r1_sst_pre = r1_sst*r1_pre              ; array (grid point-by-grid
point) multiply

Ndof = N*(1-r1_sst_pre)/(1+r1_sst_pre), where N is the original sample
size of time series

printVarSummary(Ndof)                   ; (nlat,mlon)

printMinMax(Ndof,0)

====
(2)
Perhaps, a better approach:

DOI: 10.1016/S0275-1062(04)90014-8
(2004) Determination of the degree of freedom of digital filtered time
series with an application to the correlation analysis between the length
of day and the Southern oscillation index
====

Again, it is best to talk with a statistician.

On Wed, Dec 2, 2020 at 5:26 PM dickson mbigi via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hi everyone,
> I have sst(time) and pre(lon,lat,time) low pass filtered data sets. I can
> calculate spatial correlation, but for the significance test   using
> Student's t- test I need to use effective degrees of freedom because  my
> data have been filtered. I went through NCL website and found ''equivalent
> sample size'' function which I think is quite different from the effective
> degrees of freedom. Is there a function or a way to use Effective Degree of
> freedom to perform significance tests in spatial correlation analysis?
>
> Ndof =N(1-r1r2)/(1+r1r2), where N is sample size, r1&r2 are the lag-1
> autocorrelations of the two time series.
>