0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_corr::autocorr Interface Reference

Autocorrelation function with lag k. More...

Public Member Functions

real(sp) function autocorr_sp (x, k, mask)
 
real(dp) function autocorr_dp (x, k, mask)
 
real(sp) function, dimension(size(k)) autocorr_1d_sp (x, k, mask)
 
real(dp) function, dimension(size(k)) autocorr_1d_dp (x, k, mask)
 

Detailed Description

Autocorrelation function with lag k.

Element at lag k of autocorrelation function

\[ ACF(x,k) = \frac{s_{x,k}}{s_{x,0}} \]

where \( s_{x,k} \) is the autocorrelation coefficient

\[ s_{x,k} = \langle (x_i-\bar{x})(x_{i+k}-\bar{x})\rangle \]

If an optional mask is given, the calculations are only over those locations that correspond to true values in the mask.
\( x \) can be single or double precision. The result will have the same numerical precision.

Example

Autocorrelation of 0 time steps

ak = autocorr(x, 0, mask=mask)
---> ak = 1
Parameters
[in]real(sp/dp) :: x(:)Time series.
[in]integer(i4) :: k[(:)]Lag for autocorrelation.
[in]optional, logical :: mask(:)1D-array of logical values with size(vec). If present, only those locations in vec corresponding to the true values in mask are used.
Return values
real(sp/dp) :: ak[(:)]Coefficient of autocorrelation function at lag k.
Author
Matthias Cuntz
Date
Nov 2011
Author
Stephan Thober
Date
Nov 2012
  • added 1d version
Author
Sebastion Mueller
Date
Dec 2019
  • rewritten

Definition at line 57 of file mo_corr.f90.

Member Function/Subroutine Documentation

◆ autocorr_1d_dp()

real(dp) function, dimension(size(k)) mo_corr::autocorr::autocorr_1d_dp ( real(dp), dimension(:), intent(in)  x,
integer(i4), dimension(:), intent(in)  k,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 141 of file mo_corr.f90.

◆ autocorr_1d_sp()

real(sp) function, dimension(size(k)) mo_corr::autocorr::autocorr_1d_sp ( real(sp), dimension(:), intent(in)  x,
integer(i4), dimension(:), intent(in)  k,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 164 of file mo_corr.f90.

◆ autocorr_dp()

real(dp) function mo_corr::autocorr::autocorr_dp ( real(dp), dimension(:), intent(in)  x,
integer(i4), intent(in)  k,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 67 of file mo_corr.f90.

◆ autocorr_sp()

real(sp) function mo_corr::autocorr::autocorr_sp ( real(sp), dimension(:), intent(in)  x,
integer(i4), intent(in)  k,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 104 of file mo_corr.f90.


The documentation for this interface was generated from the following file: