ToBeReviewed/STATISTICS/
c_timecorrelate.pro
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).
Routine summary
- result = timecross_cov(Xd, Yd, M, nT, Ndim, Double=Double, ZERO2NAN=ZERO2NAN)
-
- result = c_timecorrelate(X, Y, Lag, Covariance=Covariance, Double=Double)
-
timecross_cov
Statistics
result = timecross_cov(Xd, Yd, M, nT, Ndim, Double=Double, ZERO2NAN=ZERO2NAN)
Parameters
Xd
Yd
M
nT
Ndim
Keywords
Double
If set to a non-zero value, computations are done in
double precision arithmetic.
ZERO2NAN
Examples
Version history
Version
$Id: c_timecorrelate.pro 163 2006-08-29 12:59:46Z navarro $
History
c_timecorrelate
Statistics
result = c_timecorrelate(X, Y, Lag, Covariance=Covariance, Double=Double)
Parameters
X
in
required
type: array
An Array which last dimension is the time dimension of
size n, float or double.
Y
in
required
type: array
An Array which last dimension is the time dimension of
size n, float or double.
Lag
in
required
type: scalar or vector
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.
Keywords
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.
Examples
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]
Version history
Version
$Id: c_timecorrelate.pro 163 2006-08-29 12:59:46Z navarro $
History
- 01/03/2000 Sebastien Masson (smasson@lodyc.jussieu.fr)
Based on the C_CORRELATE procedure of IDL
- August 2003 Sebastien Masson
update according to the update made in C_CORRELATE by
W. Biagiotti and available in IDL 5.5
INTRODUCTION TO STATISTICAL TIME SERIES
Wayne A. Fuller
ISBN 0-471-28715-6
Produced by IDLdoc 2.0 on Wed Sep 13 16:32:56 2006.