Close
Close window
CrossCorrelation - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

Statistics

CrossCorrelation

compute sample cross-correlations of two time series

Calling Sequence

CrossCorrelation(X1, X2)

CrossCorrelation(X1, X2, lags)

Parameters

X1, X2

-

discrete univariate time series given as Vectors, lists, Matrices with one column, or TimeSeries objects with one dataset.

lags

-

(optional) maximal lag to return, or a range of lags to return. By default all possible lags are returned.

Options

scaling

One of biased, unbiased, or none. Default is none. scaling=biased computes Rk=Ckn. scaling=unbiased scales each Ck by 1nk.

raw

If this option is given, the output is not normalized so that the middle entry (corresponding to R0) is 1 when scaling=unbiased or scaling=none.

Description

For a discrete time series X1 and X2, the CrossCorrelation command computes the cross-correlations Rk=CkC0 where Ck=t=1nkX1tX2t+k&conjugate0; for k=n+1..n1.

For efficiency, all of the lags are computed at once using a numerical discrete Fourier transform. Therefore all data provided must have type complexcons and all returned solutions are floating-point, even if the problem is specified with exact values.

If the inputs are not the same length, the shorter is padded with zeros at the end.

Note: CrossCorrelation makes use of DiscreteTransforms[FourierTransform] which works strictly in hardware precision, and thus the accuracy of the cross-correlation is not purely determined by the setting of Digits.

For more time series related commands, see the TimeSeriesAnalysis package.

Examples

>

withStatistics:

>

CrossCorrelation1,2,1,2,1,2,1,2

0.2000000000622400.5000000000305990.5999999999867191.0.5999999999867190.5000000000305990.200000000062240

(1)
>

CrossCorrelation1,2,1,2,1,2,1,2,2

0.5000000000305990.5999999999867191.0.5999999999867190.500000000030599

(2)
>

CrossCorrelation1,2,1,2,1,2,1,2,2..2

0.5000000000305990.5999999999867191.0.5999999999867190.500000000030599

(3)
>

CrossCorrelation1,2,1,2,1,2,1,2,2,scaling=unbiased

1.000000000061200.7999999999822921.0.7999999999822921.00000000006120

(4)
>

CrossCorrelation1,2,3,4,5

0.8571428571961741.642857142967681.0.3571428571743542.32142559164592×10−11

(5)
>

CrossCorrelation1,2,3,4,5,0

0.8571428571961741.642857142967681.0.3571428571743542.32142559164592×10−11

(6)
>

CrossCorrelation4,5,1,2,3

2.32142559164592×10−110.3571428571743541.1.642857142967680.857142857196174

(7)
>

CrossCorrelation4,5,0,1,2,3

2.32142559164592×10−110.3571428571743541.1.642857142967680.857142857196174

(8)

The CrossCorrelation command also accepts TimeSeries objects, but the date information is ignored.

>

t1TimeSeriesAnalysis:-TimeSeries4,5,0,enddate=2012年01月01日,frequency=monthly

t1Time seriesdata set3 rows of data:2011年11月01日 - 2012年01月01日

(9)
>

t2TimeSeriesAnalysis:-TimeSeries1,2,3,enddate=2015年09月30日,frequency=daily

t2Time seriesdata set3 rows of data:2015年09月28日 - 2015年09月30日

(10)
>

CrossCorrelationt1,t2

2.32142559164592×10−110.3571428571743541.1.642857142967680.857142857196174

(11)
>

t3TimeSeriesAnalysis:-TimeSeries4,5,0,1,2,3,headers=Sales,Profits,enddate=2013年05月01日,frequency=weekly

t3Time seriesSales, Profits3 rows of data:2013年04月17日 - 2013年05月01日

(12)
>

CrossCorrelationt3..,Sales,t3..,Profits

2.32142559164592×10−110.3571428571743541.1.642857142967680.857142857196174

(13)

CrossCorrelation can be used to create cross-correlograms

>

LLinearAlgebra:-RandomVector1000,datatype=float:

>

SCrossCorrelation132L101..1000+L51..950,L1..900,150,scaling=unbiased,raw:

>

ColumnGraphS,offset=151,color=Gray,style=polygon

Compatibility

The Statistics[CrossCorrelation] command was introduced in Maple 15.

For more information on Maple 15 changes, see Updates in Maple 15 .

The Statistics[CrossCorrelation] command was updated in Maple 2015.

The X1 parameter was updated in Maple 2015.


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /