<<prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

ToBeReviewed/STATISTICS/

c_timecorrelate.pro

Routine summary

result = TimeCross_Cov(Xd, Yd, M, nT, Ndim, Double=Double, ZERO2NAN=ZERO2NAN)

NAME: C_TIMECORRELATE PURPOSE: This function computes the "time cross correlation" Pxy(L) or the "time cross covariance" between 2 arrays (this is some kind of c_correlate but for multidimenstionals arrays) as a function of the lag (L).

result = C_Timecorrelate(X, Y, Lag, Covariance=Covariance, Double=Double)

topTimeCross_Cov

result = TimeCross_Cov(Xd, Yd, M, nT, Ndim, Double=Double, ZERO2NAN=ZERO2NAN)

NAME: C_TIMECORRELATE PURPOSE: This function computes the "time cross correlation" Pxy(L) or the "time cross covariance" between 2 arrays (this is some kind of c_correlate but for multidimenstionals arrays) as a function of the lag (L). CATEGORY: Statistics. CALLING SEQUENCE: Result = c_timecorrelate(X, Y, Lag) INPUTS: X: an Array which last dimension is the time dimension of size n, float or double. Y: an Array which last dimension is the time dimension of size n, float or double. LAG: A scalar or n-element vector, in the interval [-(n-2), (n-2)], of type integer that specifies the absolute distance(s) between indexed elements of X. KEYWORD PARAMETERS: COVARIANCE: If set to a non-zero value, the sample cross covariance is computed. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE Define two n-element sample populations. x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95] Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7 lag = [-5, 0, 1, 5, 6, 7] result = c_timecorrelate(x, y, lag) The result should be: [-0.428246, 0.914755, 0.674547, -0.405140, -0.403100, -0.339685] PROCEDURE: FOR L>=0 n-L-1 sigma (X[k]-Xmean)(Y[k+L]-Ymean) k=0 correlation(X,Y,L)=------------------------------------------------------ n-1 n-1 sqrt( (sigma (X[k]-Xmean)^2)*(sigma (Y[k]-Ymean)^2)) k=0 k=0 n-L-1 sigma (X[k]-Xmean)(Y[k+L]-Ymean) k=0 covariance(X,Y,L)=------------------------------------------------------ n FOR L<0 n-L-1 sigma (X[k+L]-Xmean)(Y[k]-Ymean) k=0 correlation(X,Y,L)=------------------------------------------------------ n-1 n-1 sqrt( (sigma (X[k]-Xmean)^2)*(sigma (Y[k]-Ymean)^2)) k=0 k=0 n-L-1 sigma (X[k+L]-Xmean)(Y[k]-Ymean) k=0 covariance(X,Y,L)=------------------------------------------------------ n Where Xmean and Ymean are the time means of the sample populations x=(x[t=0],x[t=1],...,x[t=n-1]) and y=(y[t=0],y[t=1],...,y[t=n-1]), respectively. REFERENCE: INTRODUCTION TO STATISTICAL TIME SERIES Wayne A. Fuller ISBN 0-471-28715-6 MODIFICATION HISTORY:

Parameters

Xd       

Yd       

M       

nT       

Ndim       

Keywords

Double       

ZERO2NAN       

topC_Timecorrelate

result = C_Timecorrelate(X, Y, Lag, Covariance=Covariance, Double=Double)

Parameters

X       

Y       

Lag       

Keywords

Covariance       

Double       

Produced by IDLdoc 2.0.