Correlogram - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Statistics

 Correlogram
 create a column plot of the autocorrelations of data

 Calling Sequence Correlogram(X, options) AutoCorrelationPlot(X, options)

Parameters

 X - data set (1-dimensional), DataSeries options - (optional) equation(s) of the form option=value where option is one of lags or nocaption or any option recognized by Statistics[ColumnPlot].

Description

 • The Correlogram command computes autocorrelations of the data X and displays them as a column plot with dashed lines indicating the lower and upper 95% confidence bands for the normal distribution $N\left(0,\frac{1}{L}\right)$, where L is the size of the sample X, and a caption reporting how many of the displayed columns lie outside of the bands of plus or minus 2, 3, and 4 standard deviations respectively.
 • The AutoCorrelationPlot command is provided as an alias.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $L≔\mathrm{LinearAlgebra}:-\mathrm{RandomVector}\left[\mathrm{row}\right]\left(10000,\mathrm{generator}=0..1\right)$
 ${L}{≔}\left[{1}{,}{1}{,}{0}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{1}{,}{0}{,}{1}{,}{0}{,}{1}{,}{1}{,}{0}{,}{1}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{0}{,}{1}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{0}{,}{1}{,}{0}{,}{0}{,}{0}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{0}{,}{1}{,}{1}{,}{0}{,}{1}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{0}{,}{0}{,}{0}{,}{0}{,}{1}{,}{1}{,}{0}{,}{1}{,}{0}{,}{1}{,}{0}{,}{1}{,}{0}{,}{1}{,}{0}{,}{0}{,}{0}{,}{1}{,}{0}{,}{0}{,}{\dots }{,}{\text{⋯ 9900 row vector entries not shown}}\right]$ (1)
 > $\mathrm{Correlogram}\left(L\right)$
 > $\mathrm{Correlogram}\left(L,\mathrm{lags}=100\right)$
 > $\mathrm{Correlogram}\left(L,\mathrm{nocaption}\right)$

Autocorrelation can be used to create correlograms which are useful for detecting periodicity in signals.

 > $R≔⟨\mathrm{seq}\left(\frac{1}{3}\left(\mathrm{evalf}\left(\mathrm{sin}\left(17.2i\right)\mathrm{cos}\left(13.8i\right)+1.17\right)+\frac{\mathrm{rand}\left(0..1\right)\left(\right)\cdot 2}{3}\right),i=1..500\right)⟩$
 ${R}{≔}\begin{array}{c}\left[\begin{array}{c}{0.5022924310}\\ {0.3491554423}\\ {0.3375294174}\\ {0.3672458047}\\ {0.3064373098}\\ {0.4562948270}\\ {0.4122422130}\\ {0.7895597522}\\ {0.5851758922}\\ {0.6199950623}\\ {⋮}\end{array}\right]\\ \hfill {\text{500 element Vector[column]}}\end{array}$ (2)
 > $\mathrm{LineChart}\left(R,\mathrm{size}=\left[0.5,"golden"\right]\right)$
 > $\mathrm{Correlogram}\left(R,\mathrm{lags}=100\right)$

Periodicity in a time series can be observed with Autocorrelation.

 > $\mathrm{with}\left(\mathrm{TimeSeriesAnalysis}\right):$
 > $\mathrm{Data}≔\mathrm{Import}\left("datasets/sunspots.csv",\mathrm{base}=\mathrm{datadir},\mathrm{output}=\mathrm{Matrix}\right)$
 ${\mathrm{Data}}{≔}\begin{array}{c}\left[\begin{array}{cc}{"Date"}& {"Mean Sunspot Number"}\\ {1700}& {5.0}\\ {1701}& {11.0}\\ {1702}& {16.0}\\ {1703}& {23.0}\\ {1704}& {36.0}\\ {1705}& {58.0}\\ {1706}& {29.0}\\ {1707}& {20.0}\\ {1708}& {10.0}\\ {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{315 × 2 Matrix}}\end{array}$ (3)
 > $\mathrm{tsData}≔\mathrm{TimeSeries}\left(\mathrm{Data}\left[265..310,2\right]\right)$
 ${\mathrm{tsData}}{≔}\left[\begin{array}{c}{\mathrm{Time series}}\\ {\mathrm{data set}}\\ {\mathrm{46 rows of data:}}\\ {\mathrm{1975 - 2020}}\end{array}\right]$ (4)
 > $\mathrm{Correlogram}\left(\mathrm{GetData}\left(\mathrm{tsData}\right)\right)$

Compatibility

 • The Statistics[Correlogram] command was introduced in Maple 2019.
 • For more information on Maple 2019 changes, see Updates in Maple 2019.

 See Also