Changeset 150 for trunk/SRC/ToBeReviewed/STATISTICS/a_correlate2d.pro
- Timestamp:
- 08/09/06 12:12:54 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/STATISTICS/a_correlate2d.pro
r134 r150 1 ;+2 ; NAME:3 ; A_CORRELATE2d4 ;5 ; PURPOSE:6 ;7 ; This function computes the autocorrelation Px(K,L) or8 ; autocovariance Rx(K,L) of a sample population X[nx,ny] as a9 ; function of the lag (K,L).10 ;11 ; CATEGORY:12 ; Statistics.13 ;14 ; CALLING SEQUENCE:15 ; Result = a_correlate2d(X, Lag)16 ;17 ; INPUTS:18 ; X: an 2 dimension Array [nx,ny]19 ;20 ; LAG: 2-element vector, in the intervals [-(nx-2), (nx-2)],[-(ny-2), (ny-2)],21 ; of type integer that specifies the absolute distance(s) between22 ; indexed elements of X.23 ;24 ; KEYWORD PARAMETERS:25 ; COVARIANCE: If set to a non-zero value, the sample autocovariance26 ; is computed.27 ;28 ; DOUBLE: If set to a non-zero value, computations are done in29 ; double precision arithmetic.30 ;31 ; EXAMPLE:32 ;33 ; PROCEDURE:34 ;35 ;36 ; nx-k-1 ny-l-137 ; sigma sigma (X[i,j]-Xmean)(X[i+k,j+l]-Ymean)38 ; i=0 j=039 ; correlation(X,[k,l])=------------------------------------------------------40 ; nx-1 ny-141 ; sigma sigma (X[i,j]-Xmean)^2)42 ; i=0 j=043 ;44 ;45 ; nx-k-1 ny-l-146 ; sigma sigma (X[i,j]-Xmean)(Y[i+k,j+l]-Ymean)47 ; i=0 j=048 ; covariance(X,[k,l])=------------------------------------------------------49 ; nx*ny50 ;51 ; Where Xmean is the mens of the sample population52 ; x=(x[0,0],x[1,0],...,x[nx-1,ny-1]).53 ;54 ;55 ; REFERENCE:56 ;57 ; MODIFICATION HISTORY:58 ; 28/2/2000 Sebastien Masson (smasson@lodyc.jussieu.fr)59 ; Based on the A_CORRELATE procedure of IDL60 ;-61 1 62 2 FUNCTION Auto_Cov2d, X, Lag, Double = Double, zero2nan = zero2nan … … 77 17 78 18 END 19 ;+ 20 ; 21 ; @file_comments 22 ; This function computes the autocorrelation Px(K,L) or 23 ; autocovariance Rx(K,L) of a sample population X[nx,ny] as a 24 ; function of the lag (K,L). 25 ; 26 ; @categories 27 ; Statistics. 28 ; 29 ; @param X {in}{required} 30 ; An 2 dimension Array [nx,ny] 31 ; 32 ; @param LAG {in}{required} 33 ; 2-element vector, in the intervals [-(nx-2), (nx-2)],[-(ny-2), (ny-2)], 34 ; of type integer that specifies the absolute distance(s) between 35 ; indexed elements of X. 36 ; 37 ; @keyword COVARIANCE 38 ; If set to a non-zero value, the sample autocovariance is computed. 39 ; 40 ; @keyword DOUBLE 41 ; If set to a non-zero value, computations are done in double precision arithmetic. 42 ; 43 ; @history 44 ; 28/2/2000 Sebastien Masson (smasson@lodyc.jussieu.fr) 45 ; Based on the A_CORRELATE procedure of IDL 46 ; 47 ; @version 48 ; $Id$ 49 ; 50 ;- 51 79 52 80 53 FUNCTION A_Correlate2d, X, Lag, Covariance = Covariance, Double = Double
Note: See TracChangeset
for help on using the changeset viewer.