CorrelationFunction
✖
CorrelationFunction
represents the correlation function at lags hspec for the random process proc.
represents the correlation function at times s and t for the random process proc.
Details
- CorrelationFunction is also known as autocorrelation or cross-correlation function (ACF or CCF).
- The following specifications can be given for hspec:
-
τ at time or lag τ {τmax} unit spaced from 0 to τmax {τmin,τmax} unit spaced from τmin to τmax {τmin,τmax,dτ} from τmin to τmax in steps of dτ {{τ1,τ2,…}} use explicit {τ1,τ2,…} - CorrelationFunction[{x1,…,xn},h] is equivalent to with =Mean[{x1,…,xn}].
- When data is TemporalData containing an ensemble of paths, the output represents the average across all paths.
- CorrelationFunction of the process proc is the CovarianceFunction c normalized by the outer product of the standard deviation function σ at times s and t:
-
c[s,t]/(σ[s]σ[t]) for scalar-valued data or processes c[s,t]/(σ[s] ⊗ σ[t]) for vector-valued data or processes - The symbol ⊗ represents KroneckerProduct.
- CorrelationFunction[proc,h] is defined only if proc is a weakly stationary process and is equivalent to CorrelationFunction[proc,h,0].
- The process proc can be any random process, such as ARMAProcess and WienerProcess.
Examples
open allclose allBasic Examples (4)Summary of the most common use cases
Estimate the correlation function at lag 2:
https://wolfram.com/xid/0b0kd6m5nki-7xwnvr
The sample correlation function for a random sample from an autoregressive time series:
https://wolfram.com/xid/0b0kd6m5nki-mzk4
https://wolfram.com/xid/0b0kd6m5nki-4ic4n4
The correlation function for a discrete-time process:
https://wolfram.com/xid/0b0kd6m5nki-nisq3j
https://wolfram.com/xid/0b0kd6m5nki-yc0s4f
The correlation function for a continuous-time process:
https://wolfram.com/xid/0b0kd6m5nki-86zoz2
https://wolfram.com/xid/0b0kd6m5nki-cb5pyd
Scope (13)Survey of the scope of standard use cases
Empirical Estimates (7)
Estimate the correlation function for some data at lag 9:
https://wolfram.com/xid/0b0kd6m5nki-e2gx6r
Obtain empirical estimates of the correlation function up to lag 9:
https://wolfram.com/xid/0b0kd6m5nki-lpyp8t
Compute the correlation function for lags 1 to 9 in steps of 2:
https://wolfram.com/xid/0b0kd6m5nki-bdsgu1
Compute the correlation function for a time series:
https://wolfram.com/xid/0b0kd6m5nki-fk4573
The correlation function of a time series for multiple lags is given as a time series:
https://wolfram.com/xid/0b0kd6m5nki-83mv4
https://wolfram.com/xid/0b0kd6m5nki-5ep7bs
Estimate the correlation function for an ensemble of paths:
https://wolfram.com/xid/0b0kd6m5nki-f8uvhg
https://wolfram.com/xid/0b0kd6m5nki-myqy3
https://wolfram.com/xid/0b0kd6m5nki-c1pvcs
Compare empirical and theoretical correlation functions:
https://wolfram.com/xid/0b0kd6m5nki-jmctrn
https://wolfram.com/xid/0b0kd6m5nki-ffbta1
https://wolfram.com/xid/0b0kd6m5nki-ci02wh
Plot the cross-correlation for vector data:
https://wolfram.com/xid/0b0kd6m5nki-5ejkpt
https://wolfram.com/xid/0b0kd6m5nki-emzkrl
Random Processes (6)
The correlation function for a weakly stationary discrete-time process:
https://wolfram.com/xid/0b0kd6m5nki-jlvt9
https://wolfram.com/xid/0b0kd6m5nki-c08pf3
The correlation function only depends on the antidiagonal :
https://wolfram.com/xid/0b0kd6m5nki-drb7n6
https://wolfram.com/xid/0b0kd6m5nki-9gw5a
The correlation function for a weakly stationary continuous-time process:
https://wolfram.com/xid/0b0kd6m5nki-bsxrpt
https://wolfram.com/xid/0b0kd6m5nki-6xr1r
The correlation function only depends on the antidiagonal :
https://wolfram.com/xid/0b0kd6m5nki-ct9g81
https://wolfram.com/xid/0b0kd6m5nki-drlf7
The correlation function for a non-weakly stationary discrete-time process:
https://wolfram.com/xid/0b0kd6m5nki-rlsomi
https://wolfram.com/xid/0b0kd6m5nki-spx2b3
The correlation function depends on both time arguments:
https://wolfram.com/xid/0b0kd6m5nki-8vday0
https://wolfram.com/xid/0b0kd6m5nki-iykr60
The correlation function for a non-weakly stationary continuous-time process:
https://wolfram.com/xid/0b0kd6m5nki-5eak2t
https://wolfram.com/xid/0b0kd6m5nki-8bxuw9
The correlation function depends on both time arguments:
https://wolfram.com/xid/0b0kd6m5nki-sv9v1p
https://wolfram.com/xid/0b0kd6m5nki-cf7247
The correlation function for some time series processes:
https://wolfram.com/xid/0b0kd6m5nki-mvkkky
https://wolfram.com/xid/0b0kd6m5nki-uovwag
Cross-correlation plots for a vector ARProcess:
https://wolfram.com/xid/0b0kd6m5nki-soinyv
https://wolfram.com/xid/0b0kd6m5nki-izvng2
Applications (2)Sample problems that can be solved with this function
Determine whether the following data is best modeled with an MAProcess or an ARProcess:
https://wolfram.com/xid/0b0kd6m5nki-c3c54
It is difficult to determine the underlying process from sample paths:
https://wolfram.com/xid/0b0kd6m5nki-xt365
https://wolfram.com/xid/0b0kd6m5nki-gd19j1
The correlation function of the data decays slowly:
https://wolfram.com/xid/0b0kd6m5nki-ka6ks
ARProcess is clearly a better candidate model than MAProcess:
https://wolfram.com/xid/0b0kd6m5nki-9y8np
Create an ACF plot with white-noise confidence bands:
https://wolfram.com/xid/0b0kd6m5nki-e2rla3
https://wolfram.com/xid/0b0kd6m5nki-flu59
Plot the correlation for lags 0 to 20 with 95% white-noise confidence bands:
https://wolfram.com/xid/0b0kd6m5nki-f8zsnf
Compare to uncorrelated white noise:
https://wolfram.com/xid/0b0kd6m5nki-mo2t0u
Properties & Relations (12)Properties of the function, and connections to other functions
Sample correlation function is a biased estimator for the process correlation function:
https://wolfram.com/xid/0b0kd6m5nki-2r99uh
Calculate the sample correlation function:
https://wolfram.com/xid/0b0kd6m5nki-bmgyvh
https://wolfram.com/xid/0b0kd6m5nki-04ho15
Correlation function for the process:
https://wolfram.com/xid/0b0kd6m5nki-oz6gf8
https://wolfram.com/xid/0b0kd6m5nki-bfv26f
Correlation function for a process is the off-diagonal entry in the Correlation matrix:
https://wolfram.com/xid/0b0kd6m5nki-c8x3e0
https://wolfram.com/xid/0b0kd6m5nki-cs2zy3
https://wolfram.com/xid/0b0kd6m5nki-hpmt
https://wolfram.com/xid/0b0kd6m5nki-dmok3u
Sample correlation at lag 0 is always 1:
https://wolfram.com/xid/0b0kd6m5nki-qm6j3s
Sample correlation function is related to CovarianceFunction:
https://wolfram.com/xid/0b0kd6m5nki-1zztsb
https://wolfram.com/xid/0b0kd6m5nki-glovgg
Scaled sample covariance function:
https://wolfram.com/xid/0b0kd6m5nki-tqx7q2
https://wolfram.com/xid/0b0kd6m5nki-r5gd6z
Sample correlation function is related to AbsoluteCorrelationFunction:
https://wolfram.com/xid/0b0kd6m5nki-qr7h7n
https://wolfram.com/xid/0b0kd6m5nki-klbxo4
https://wolfram.com/xid/0b0kd6m5nki-or7b5
Compare to the sample correlation function:
https://wolfram.com/xid/0b0kd6m5nki-mebes9
https://wolfram.com/xid/0b0kd6m5nki-innlhe
Use Expectation to calculate correlation:
https://wolfram.com/xid/0b0kd6m5nki-3et4et
Define mean and standard deviation functions:
https://wolfram.com/xid/0b0kd6m5nki-18ookb
https://wolfram.com/xid/0b0kd6m5nki-ke17gx
https://wolfram.com/xid/0b0kd6m5nki-3qbaum
https://wolfram.com/xid/0b0kd6m5nki-l8tycf
Correlation function for equal times reduces to 1:
https://wolfram.com/xid/0b0kd6m5nki-4mmjhb
Correlation function is related to the CovarianceFunction :
https://wolfram.com/xid/0b0kd6m5nki-jty7ss
https://wolfram.com/xid/0b0kd6m5nki-bx3wkf
For , the standard deviation function is :
https://wolfram.com/xid/0b0kd6m5nki-w2lngg
https://wolfram.com/xid/0b0kd6m5nki-z45hm3
The correlation function is related to the Correlation:
https://wolfram.com/xid/0b0kd6m5nki-hfa3ic
https://wolfram.com/xid/0b0kd6m5nki-czrj76
It is the off-diagonal entry in the covariance matrix:
https://wolfram.com/xid/0b0kd6m5nki-krwlbm
https://wolfram.com/xid/0b0kd6m5nki-fl2uik
Correlation function is invariant for ToInvertibleTimeSeries:
https://wolfram.com/xid/0b0kd6m5nki-sc3ri6
https://wolfram.com/xid/0b0kd6m5nki-0gzrsk
https://wolfram.com/xid/0b0kd6m5nki-ng1jmj
Correlation function is invariant to centralizing:
https://wolfram.com/xid/0b0kd6m5nki-j6e14d
https://wolfram.com/xid/0b0kd6m5nki-3y2jx0
https://wolfram.com/xid/0b0kd6m5nki-qwlcfc
Compare correlation functions:
https://wolfram.com/xid/0b0kd6m5nki-n5g69
Sum of the sample correlation function is constant:
https://wolfram.com/xid/0b0kd6m5nki-7qui4f
https://wolfram.com/xid/0b0kd6m5nki-8xh624
Calculate the sample correlation function from 1 to n-1:
https://wolfram.com/xid/0b0kd6m5nki-lxdynr
https://wolfram.com/xid/0b0kd6m5nki-6i1m8o
Possible Issues (1)Common pitfalls and unexpected behavior
CorrelationFunction output may contain DifferenceRoot:
https://wolfram.com/xid/0b0kd6m5nki-zoh06c
Use FunctionExpand to recover explicit powers:
https://wolfram.com/xid/0b0kd6m5nki-eoxost
Wolfram Research (2012), CorrelationFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CorrelationFunction.html.
Text
Wolfram Research (2012), CorrelationFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CorrelationFunction.html.
Wolfram Research (2012), CorrelationFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CorrelationFunction.html.
CMS
Wolfram Language. 2012. "CorrelationFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CorrelationFunction.html.
Wolfram Language. 2012. "CorrelationFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CorrelationFunction.html.
APA
Wolfram Language. (2012). CorrelationFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CorrelationFunction.html
Wolfram Language. (2012). CorrelationFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CorrelationFunction.html
BibTeX
@misc{reference.wolfram_2024_correlationfunction, author="Wolfram Research", title="{CorrelationFunction}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/CorrelationFunction.html}", note=[Accessed: 10-January-2025
]}
BibLaTeX
@online{reference.wolfram_2024_correlationfunction, organization={Wolfram Research}, title={CorrelationFunction}, year={2012}, url={https://reference.wolfram.com/language/ref/CorrelationFunction.html}, note=[Accessed: 10-January-2025
]}