Re: Help: Is there anything wrong with esccr(x, y, mxlag) ?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed, 25 Mar 2009 22:33:14 -0600

Please read the documentation.

http://www.ncl.ucar.edu/Document/Functions/Built-in/esccr.shtml

Specifically:

When calculating lag cross correlations Chatfield (pp. 60-62, p. 173)
recommends using the entire series (i.e. all non-missing values) to
estimate mean and standard deviation rather than (N-k) values. The
reason is better mean-square error properties.

There are trade-offs to be made. For example, it is possible that
correlation coefficients calculated using qAve and qStd based on the
entire series can lead to correlation coefficients that are > 1. or <
-1. This is because the subset (N-k) points might be a series with
slightly different statistical characteristics.

Thus, the qAve, sAve, qStd, sStd, qVar estimates are calculated using
the entire series. In the case of, say, esccr, the qAve, qStd could be
based upon L non-missing values while the sAve, sStd could be based upon
M non-missing values. It is felt that this approach yields the best
statistical estimates of these quantities.

duzhencai wrote:
> Hello NCL users,
>
> When I was calculating the correlation coefficient of 2 time series,
> I found the result can be great than 1.
> These results puzzle me a lot.
> I write you to see if anyone can help me figure it out.
> Thanks.
> ZhenCai DU
> 2009-03-26
>
> Center for Monsoon System Research(CMSR),
> Institute of Atmospheric Physics(IAP),
> Chinese Academy of Sciences(CAS)
> http://xiaonei.com/iapdzc
> http://cmsr.iap.ac.cn <http://cmsr.iap.ac.cn/>
> ============================================
> $ ncl -V
> 5.1.0
> $ uname -a
> Linux e5430.iap.ac.cn 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
>
> Followings are the scripts and results I get:
> scripts:
> ---------
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> lonsb = 35
> loneb = 65
> latsb = 0
> lateb = 10
> pnb = 130
> ptb = 40
> ms = new((/5,40,130/),float,"No_FillValue") ;
> ccc=0
> do jlat=1,40
> do ilon=1,130
> lns=lonsb+ilon
> lne=loneb+ilon
> lts=latsb+jlat
> lte=lateb+jlat
>
> lnse=lonsb+ilon-35
> lnee=loneb+ilon-35
> ltse=latsb+jlat
> ltee=lateb+jlat
>
> sprcmap = pr(0 ,2,{lts:lte},{lns:lne})
> selprcmap = sprcmap*conform(sprcmap, wgty({lat|lts:lte}), 0) ; wgt by lat.
> spr = ens(26,ltse:ltee,lnse:lnee) ;1-161 1-51 ;select
> selpr = spr*conform(spr, wgty({lat|lts:lte}), 0) ; wgt by lat.
>
> ms(0,jlat-1,ilon-1) = esccr (ndtooned(selpr), ndtooned(selprcmap) ,0 )
> if (ms(0,jlat-1,ilon-1) .gt. 1)then
> print( ms(0,jlat-1,ilon-1) )
> print(jlat-1)
> print(ilon-1)
> ccc=ccc+1
> end if
> .................
> .................
> end do
> end do
> print(ccc)
> -------------------
> some results:
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.002971
> (0) 15
> (0) 6
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.004609
> (0) 15
> (0) 7
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.007139
> (0) 16
> (0) 3
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.014018
> (0) 16
> (0) 4
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.010615
> (0) 16
> (0) 5
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.012321
> (0) 16
> (0) 6
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.010329
> (0) 16
> (0) 7
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.001603
> (0) 17
> (0) 8
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.004034
> (0) 18
> (0) 8
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.013788
> (0) 23
> (0) 10
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.015457
> (0) 24
> (0) 10
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.018762
> (0) 25
> (0) 10
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.023152
> (0) 25
> (0) 11
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.023217
> (0) 25
> (0) 12
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.016919
> (0) 25
> (0) 13
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.016928
> (0) 26
> (0) 10
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.024574
> (0) 26
> (0) 11
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.028466
> (0) 26
> (0) 12
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.025715
> (0) 26
> (0) 13
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.021161
> (0) 27
> (0) 9
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.042357
> (0) 27
> (0) 10
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.047243
> (0) 27
> (0) 11
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.043814
> (0) 27
> (0) 12
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.037192
> (0) 27
> (0) 13
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.021154
> (0) 27
> (0) 14
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.022508
> (0) 28
> (0) 10
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.035104
> (0) 28
> (0) 11
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.034002
> (0) 28
> (0) 12
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.030361
> (0) 28
> (0) 13
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.019935
> (0) 28
> (0) 14
>
>
> Variable: ms (subsection)
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 1.003395
> (0) 28
> (0) 15
>
>
> Variable: ccc
> Type: integer
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 31
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 25 2009 - 22:33:14 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 06 2009 - 10:23:30 MDT