autoco(3f) - [M_datapac:STATISTICS] compute the sample autocorrelation coefficient
Synopsis
Description
Input Arguments
Output Arguments
Examples
References
Author
Maintainer
License
SUBROUTINE AUTOCO(X,N,Iwrite,Xautoc)
Real(kind=wp), Intent (InOut) :: X(:) Integer, Intent (In) :: Iwrite Real(kind=wp), Intent (In) :: Xautoc
AUTOCO(3f) computes the sample autocorrelation coefficient of the data in the input vector X. The sample autocorrelation coefficient equals the correlation between X(I) and X(I+1) over the entire sample. The autocorrelation coefficient coefficient will be a REAL value between -1.0 and 1.0 (inclusively).
X The REAL vector of (unsorted) observations. N The integer number of observations in the vector x. IWRITE An integer flag code which (if set to 0) will suppress the printing of the sample autocorrelation coefficient as it is computed; or (if set to some integer value not equal to 0), like, say, 1) will cause the printing of the sample autocorrelation coefficient at the time it is computed.
XAUTOC The REAL value of the computed sample autocorrelation coefficient. This REAL value will be between -1.0 and 1.0 (inclusively).
Sample program:
program demo_autoco use M_datapac, only : autoco, label implicit none real :: x(100) call label(autoco) !call call autoco(x,size(x),1,xautoc) end program demo_autocoResults:
Jenkins and Watts, Spectral Analysis and its Applications, 1968, pages 5, 182.
The original DATAPAC library was written by James J. Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
Nemo Release 3.1 | autoco (3) | February 23, 2025 |