CorrelationFunction[data,hspec]
data からの遅れ hspec における相関関数を推定する.
CorrelationFunction[proc,hspec]
遅れ hspec におけるランダム過程 proc の相関関数を表す.
CorrelationFunction[proc,s,t]
時間 s および t におけるランダム過程 proc の相関関数を表す.
CorrelationFunction
CorrelationFunction[data,hspec]
data からの遅れ hspec における相関関数を推定する.
CorrelationFunction[proc,hspec]
遅れ hspec におけるランダム過程 proc の相関関数を表す.
CorrelationFunction[proc,s,t]
時間 s および t におけるランダム過程 proc の相関関数を表す.
詳細
- CorrelationFunctionは自己相関関数(ACF)あるいは相互相関関数(CCF)としても知られている.
- hspec には次の指定を使うことができる.
-
τ 時間または遅れ τ で {τmax} 0から τmaxまで等間隔で {τmin,τmax} τminから τmaxまで等間隔で {τmin,τmax,dτ} τmin から τmaxまで刻み幅 dτ で {{τ1,τ2,…}} 明示的な{τ1,τ2,…}を使う - CorrelationFunction[{x1,…,xn},h]は
=Mean[{x1,…,xn}]である
に等しい. - data が,経路の集合体を含むTemporalDataであるとき,その出力はすべての経路の平均を表す.
- 過程 proc のCorrelationFunctionは,時間 s および t における,標準偏差関数 σ の外積によって正規化されたCovarianceFunction c である.
-
c[s,t]/(σ[s]σ[t]) スカラー値のデータまたは過程について c[s,t]/(σ[s] ⊗ σ[t]) ベクトル値のデータまたは過程について - 記号 ⊗ はKroneckerProductである.
- CorrelationFunction[proc,h]は proc が弱定常過程でCorrelationFunction[proc,h,0]と等しいときにのみ定義される.
- 過程 proc はARMAProcessまたはWienerProcessのような任意のランダム過程である.
例題
すべて開く すべて閉じる例 (4)
CorrelationFunction[{2, 3, 4, 3}, 2]data = RandomFunction[ARProcess[{.2, .3, .4}, 1], {1, 10 ^ 4}];ListPlot[CorrelationFunction[data, {20}], Filling -> Axis, PlotRange -> All]CorrelationFunction[BinomialProcess[p], s, t]DiscretePlot3D[Evaluate[% /. {p -> 2 / 3}], {s, 1, 10}, {t, 1, 10}, ExtentSize -> 1 / 2, ColorFunction -> "Rainbow"]CorrelationFunction[WienerProcess[μ, σ], s, t]Plot3D[Evaluate[% /. {μ -> 1, σ -> 2}], {s, 0, 10}, {t, 0, 10}, ColorFunction -> "Rainbow"]スコープ (13)
経験的推定値 (7)
CorrelationFunction[Range[10], 9]CorrelationFunction[Range[10], {9}]CorrelationFunction[Range[10], {1, 9, 2}]ts = TemporalData[TimeSeries, {{{-2.9904395734335427, -1.5547517217370468, -2.007044987914736,
-0.7114933373063236, -1.5920036118254968, 0.23183536513859127, 0.056774681349179124,
0.32394041932443046, 0.10382798659711348, -0.684046765274114, - ... 1687325555,
3.410933732368106, 2.5200924558212163, 2.008558601261935, 0.43151331467691206,
0.6249727955196763}}, {{1, 1000, 1}}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1, ResamplingMethod -> None}}, False, 10.1];複数の遅れについての時系列の相関関数は,時系列として返される:
corr = CorrelationFunction[ts, {100}]ListPlot[corr, Filling -> Axis]data = RandomFunction[ARProcess[{.8}, 1], {0, 500}, 10]corr = CorrelationFunction[data, {12}];ListPlot[corr, Filling -> 0]proc = MAProcess[{.4, .3, .5, .6, .3}, 1.];data = RandomFunction[proc, {0, 1000}];ListPlot[TemporalData[CorrelationFunction[#, {10}]& /@ {proc, data}], Filling -> {1 -> {2}}, PlotStyle -> PointSize[Medium]]proc = ARProcess[{{{.3, .1}, {.6, .3}}}, {{1, .3}, {.3, .6}}];
data = RandomFunction[proc, {100}];
cov = CorrelationFunction[data, {-6, 6}];Table[ListPlot[cov["Values"][[All, i, j]], Filling -> 0, PlotLabel -> {i, j}], {i, 1, 2}, {j, 1, 2}]ランダム過程 (6)
CorrelationFunction[ARProcess[{a}, σ^2], s, t]//PiecewiseExpandDiscretePlot3D[Evaluate[% /. {a -> 2 / 3, σ -> 1}], {s, 0, 10}, {t, 0, 10}, ExtentSize -> 1 / 2, ColorFunction -> "Rainbow"]CorrelationFunction[ARProcess[{a}, σ^2], h]//PiecewiseExpandDiscretePlot[Evaluate[% /. {a -> 2 / 3, σ -> 1}], {h, 0, 10}, ExtentSize -> 1 / 2, ColorFunction -> "Rainbow", AxesLabel -> {h, None}]CorrelationFunction[OrnsteinUhlenbeckProcess[μ, σ, θ], s, t]Plot3D[Evaluate[% /. {μ -> 1, σ -> 2, θ -> 1 / 3}], {s, 0, 10}, {t, 0, 10}, ColorFunction -> "Rainbow"]CorrelationFunction[OrnsteinUhlenbeckProcess[μ, σ, θ], h]Plot[Evaluate[% /. {μ -> 1, σ -> 2, θ -> 1 / 3}], {h, 0, 10}, ColorFunction -> "Rainbow", Filling -> Axis, AxesLabel -> {h, None}]CorrelationFunction[BinomialProcess[p], s, t]DiscretePlot3D[Evaluate[% /. p -> 1 / 3], {s, 1, 10}, {t, 1, 10}, ExtentSize -> 1 / 2, ColorFunction -> "Rainbow"]antidiagonals = CorrelationFunction[BinomialProcess[1 / 3], t, t + h]DiscretePlot[Evaluate@Table[antidiagonals, {t, 1, 4}], {h, 0, 5}, ExtentSize -> 1 / 2, PlotLegends -> (Row[{"t = ", #}]& /@ Range[1, 4]), AxesLabel -> {h, None}]CorrelationFunction[PoissonProcess[μ], s, t]Plot3D[Evaluate[% /. μ -> 3], {s, 0, 10}, {t, 0, 10}, ColorFunction -> "Rainbow"]antidiagonals = CorrelationFunction[PoissonProcess[3], t, t + h]Plot[Evaluate@Table[antidiagonals, {t, 1, 4}], {h, 0, 5}, PlotLegends -> (Row[{"t = ", #}]& /@ Range[1, 4]), AxesLabel -> {h, None}]proc1 = ARProcess[{.8}, 1];
proc2 = MAProcess[{-.4, -.7, .6, -1}, 1];
proc3 = SARMAProcess[{}, {}, {3, {.6}, {.1}}, 1];
proc4 = FARIMAProcess[{}, 1 / 3, {}, 1];DiscretePlot[CorrelationFunction[#, h], {h, 0, 15}, ExtentSize -> 1 / 2, PlotRange -> All, PlotLabel -> Head[#]]& /@ {proc1, proc2, proc3, proc4}ベクトルARProcessについての相互相関プロット:
proc = ARProcess[{{{.3, .1}, {.6, .3}}}, {{1, .3}, {.3, .6}}];
cov = CorrelationFunction[proc, h];Table[DiscretePlot[cov[[i, j]], {h, -6, 6}, ExtentSize -> 1 / 2, PlotLabel -> {i, j}], {i, 1, 2}, {j, 1, 2}]アプリケーション (2)
次のデータはMAProcessあるいはARProcessのどちらを使った場合に最もよくモデル化ができるかを考える:
ListLinePlot[data = TemporalData[TimeSeries, {{{-1.4735257611469446, -0.9158187257309729, -1.9060205147226934,
-1.6174582169404574, -2.633459084244463, -2.104839842098871, -2.8701276893108894,
-2.4118183939601607, -0.5125633448622677, -1.2356329399850385, 1. ... 26394036266876, -0.16380797769527589, 0.3559909972777121,
1.5343047104249412, 0.10763337590714506}}, {{0, 100, 1}}, 1, {"Continuous", 1},
{"Discrete", 1}, 1, {ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, False,
10.1]]candidates = {MAProcess[{.5, .4}, 1], ARProcess[{.5, .4}, 1]};SeedRandom[2];ListLinePlot[RandomFunction[#, {0, 100}]]& /@ candidatesListPlot[CorrelationFunction[data, {10}], Filling -> 0]ARProcessは明らかにMAProcessよりもよいモデル候補である:
ListPlot[CorrelationFunction[#, {10}], PlotLabel -> Head[#], Filling -> 0]& /@ candidatesホワイトノイズの信頼帯を含む自己相関関数(ACF)プロットを作成する:
data = RandomFunction[MAProcess[{.6, .4, .5}, .1], {1, 500}];acf[data_, lmax_, clev_ : 0.95] := Show[ListPlot[CorrelationFunction[data, {0, lmax}], Filling -> Axis, PlotRange -> {{0, lmax}, All}, PlotStyle -> PointSize[Medium]],
Graphics[{Dashed, Line[{{0, #}, {lmax, #}}]}]& /@ (Quantile[NormalDistribution[], {(1 - clev/2), 1 - (1 - clev/2)}]/Sqrt[data["PathLengths"][[1]]])]95%のホワイトノイズ信頼帯で遅れ0から20までについて相関をプロットする:
acf[data, 20, .95]acf[TemporalData[RandomVariate[NormalDistribution[], 500], Automatic], 20, .95]特性と関係 (12)
proc = ARMAProcess[1, {5 / 6, -1 / 6}, {2 / 3}, 1];
paths = RandomFunction[proc, {0, n = 10}, 10 ^ 3];CorrelationFunction[paths, {10}]scorr = TimeSeriesMapThread[#2(n + 1) / (n + 1 - #1)&, %]corr = CorrelationFunction[proc, {10}]ListPlot[{scorr, corr}, Filling -> 0]過程についての相関関数は,Correlation行列の非対角項である:
𝒫 = WienerProcess[μ, σ];Correlation[𝒫[{s, t}], 1, 2]CorrelationFunction[𝒫, s, t]Simplify[%% - %, 0 < s < t]Simplify[CorrelationFunction[{x, y, z}, 0], {x, y, z}∈Reals]サンプル相関関数は,CovarianceFunctionに関連している:
data = Range[10];CorrelationFunction[data, {Length[data] - 1}]CovarianceFunction[data, {Length[data] - 1}] / CovarianceFunction[data, 0]% - %%サンプル相関関数は,AbsoluteCorrelationFunctionに関連している:
data = Range[10];
n = Length[data];AbsoluteCorrelationFunction[data - Mean[data], {n - 1}]% / First[%]CorrelationFunction[data, {n - 1}]% - %%Expectationを使って相関を計算する:
𝒫 = WienerProcess[μ, σ];sd[s_] := StandardDeviation[𝒫[s]]
m[s_] := Mean[𝒫[s]]Expectation[(x[s] - m[s])(x[t] - m[t]) / (sd[s] sd[t]), x𝒫]CorrelationFunction[𝒫, s, t]Simplify[% - %%, 0 < s < t]CorrelationFunction[PoissonProcess[μ], t, t]//Simplify[#, t > 0]&相関関数
は,CovarianceFunction
に関連している:
𝒫 = OrnsteinUhlenbeckProcess[μ, σ, θ];
sd[s_] := StandardDeviation[𝒫[s]]CorrelationFunction[𝒫, s, t]CovarianceFunction[𝒫, s, t] / (sd[s] sd[t])% - %%相関関数は,Correlationに関連している:
𝒫 = WienerProcess[μ, σ];CorrelationFunction[𝒫, s, t]Correlation[𝒫[{s, t}], 1, 2]Simplify[%% - %, 0 < s < t]相関関数は,ToInvertibleTimeSeriesについては不変である:
TimeSeriesInvertibility[proc = MAProcess[{2, 4}, 1]]iproc = ToInvertibleTimeSeries@procCorrelationFunction[#, s, t]& /@ {proc, iproc}data = RandomFunction[ARIMAProcess[{}, 1, {}, 1], {0, 100}];Mean[data]newdata = Standardize[data, Mean, 1&];ListPlot[CorrelationFunction[#, {20}], Filling -> 0]& /@ {data, newdata}n = 100;
sample = RandomInteger[n, n];ListPlot[sample, Filling -> Axis]corr = CorrelationFunction[sample, {1, n - 1}];
ListLinePlot[corr]Total@corr考えられる問題 (1)
CorrelationFunctionの出力がDifferenceRootを含むことがある:
CorrelationFunction[ARProcess[{a, b}, σ^2], t] //Simplify[#, t > 0]&FunctionExpandを使って明示的なベキを回復する:
%//FunctionExpandテキスト
Wolfram Research (2012), CorrelationFunction, Wolfram言語関数, 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.
APA
Wolfram Language. (2012). CorrelationFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CorrelationFunction.html
BibTeX
@misc{reference.wolfram_2026_correlationfunction, author="Wolfram Research", title="{CorrelationFunction}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/CorrelationFunction.html}", note=[Accessed: 15-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_correlationfunction, organization={Wolfram Research}, title={CorrelationFunction}, year={2012}, url={https://reference.wolfram.com/language/ref/CorrelationFunction.html}, note=[Accessed: 15-September-2026]}