PartialCorrelationFunction[data,hspec]
estimates the partial correlation function at lags hspec from data.
PartialCorrelationFunction[tproc,hspec]
represents the partial correlation function at lags hspec for the time series process tproc.
PartialCorrelationFunction
PartialCorrelationFunction[data,hspec]
estimates the partial correlation function at lags hspec from data.
PartialCorrelationFunction[tproc,hspec]
represents the partial correlation function at lags hspec for the time series process tproc.
Details
- PartialCorrelationFunction is also known as the partial autocorrelation function (PACF).
- PartialCorrelationFunction represents the correlation between x(t) and x(t+h), conditioned on x(u) for t<u<t+h, and x(t) representing tproc at time t.
- PartialCorrelationFunction[tproc,hspec] is defined only if tproc is a weakly stationary process.
- The process tproc can be any process such that WeakStationarity[tproc] gives True.
- 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,…}
Examples
open all close allBasic Examples (3)
Estimate the partial correlation function at lag 2:
PartialCorrelationFunction[{2, 3, 4, 3}, 2]Sample partial correlation function for a random sample from an autoregressive time series:
data = RandomFunction[ARProcess[{.2, .3, .4}, 1], {1, 10 ^ 4}];ListPlot[PartialCorrelationFunction[data, {20}], Filling -> Axis, PlotRange -> {0, .7}]Partial correlation function for an ARProcess:
PartialCorrelationFunction[ARProcess[{a, b, c}, σ^2], h]Scope (9)
Empirical Estimates (6)
Estimate the partial correlation function for some data at lag 9:
PartialCorrelationFunction[N@Range[10], 9]Obtain empirical estimates of the partial correlation function up to lag 9:
PartialCorrelationFunction[N@Range[10], {9}]Compute the partial correlation function for lags 1 to 9 in steps of 2:
PartialCorrelationFunction[N@Range[10], {1, 9, 2}]Compute the partial correlation function for a time series:
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];The partial correlation function of a time series for multiple lags is given as a time series:
pcorr = PartialCorrelationFunction[ts, {100}]ListPlot[pcorr, Filling -> Axis]Estimate the partial correlation function for an ensemble of paths:
data = RandomFunction[ARProcess[{.8}, 1], {0, 1000}, 30]pcorr = PartialCorrelationFunction[data, {50}];ListPlot[pcorr, Filling -> 0]Compare empirical and theoretical correlation functions:
proc = MAProcess[{.4, .3, .5, .6, .3}, 1.];data = RandomFunction[proc, {0, 500}];ListPlot[TemporalData[PartialCorrelationFunction[#, {10}]& /@ {proc, data}], Filling -> {1 -> {2}}, PlotStyle -> PointSize[Medium], PlotLegends -> {"proc", "data"}]Random Processes (3)
Partial correlation function for a MAProcess has infinite support:
DiscretePlot[PartialCorrelationFunction[MAProcess[{2, -.3, -.4, .8}, 1], h], {h, 1, 20}, ExtentSize -> 1 / 2]Partial correlation function for an ARProcess has finite support:
DiscretePlot[PartialCorrelationFunction[ARProcess[{1 / 2, -1 / 4, 1 / 2, -7 / 8}, 1], h], {h, 1, 9}, ExtentSize -> 1 / 2]Partial correlation function for an ARMAProcess has infinite support:
DiscretePlot[PartialCorrelationFunction[ARMAProcess[{1 / 2, -.7}, {1, 2}, 1], h], {h, 1, 20}, PlotRange -> All, ExtentSize -> 1 / 2]Applications (2)
Determine whether the following data is best modeled with an MAProcess or an ARProcess:
ListLinePlot[data = TemporalData[TimeSeries, {{{2.5126822192120652, 0.22387067811837819, -0.8988121146184116,
-1.3383227343640944, -0.13916686675227197, 2.338786847173964, 2.0723374506371073,
0.858640500502647, 1.9638507725302705, 1.4337967391598343, 0.02965 ... 7449227101, -0.6732164334578171,
-0.9810407645253383, -1.1476769743441064}}, {{0, 100, 1}}, 1, {"Continuous", 1},
{"Discrete", 1}, 1, {ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1},
ValueDimensions -> 1}}, False, 10.1]]It is difficult to determine the underlying process from sample paths:
candidates = {MAProcess[{.5, .4}, 1], ARProcess[{.5, .4}, 1]};SeedRandom[2];ListLinePlot[RandomFunction[#, {0, 100}]]& /@ candidatesThe partial correlation function of the data decays slowly:
ListPlot[PartialCorrelationFunction[data, {10}], Filling -> 0, PlotRange -> {-.4, 1}]MAProcess is clearly a better candidate model than ARProcess:
ListPlot[PartialCorrelationFunction[#, {10}], PlotLabel -> Head[#], Filling -> 0, PlotRange -> {-.4, 1}, AxesOrigin -> {0, 0}]& /@ candidatesCreate a PACF plot with white-noise confidence bands:
data = RandomFunction[MAProcess[{.6}, .1], {1, 750}];pacf[data_, lmax_, clev_ : 0.95] := Show[ListPlot[PartialCorrelationFunction[data, {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["PathLength"]])]Plot the partial correlation to lag 20 with 95% white-noise confidence bands:
pacf[data, 20, .95]Compare to uncorrelated white noise:
pacf[TemporalData[RandomVariate[NormalDistribution[], 500], Automatic], 20, .95]Properties & Relations (3)
Sample partial correlation function is a biased estimator for the process partial correlation function:
proc = ARMAProcess[1, {5 / 6, -1 / 6}, {2 / 3}, 1];
paths = RandomFunction[proc, {0, n = 10}, 10 ^ 4];Calculate the sample partial correlation function:
spcf = PartialCorrelationFunction[paths, {n}]Partial correlation function for the process:
pcf = PartialCorrelationFunction[proc, {n}]ListPlot[{spcf, pcf}, Filling -> {1 -> {2}}, PlotRange -> All]Use CorrelationFunction to directly calculate PartialCorrelationFunction:
h = 10;
proc = MAProcess[{1 / 3, 1 / 5}, 1];
corr = CorrelationFunction[proc, {h}]["NormalValues"];Define a ToeplitzMatrix using the first
components of the correlation vector:
corrden = ToeplitzMatrix[Most[corr]];Replace the last column in the matrix with the last
components:
num = den;
num[[All, -1]] = Rest[corr];Calculate ratio of determinants:
Det[num] / Det[den]Compare to the value of PartialCorrelationFunction:
PartialCorrelationFunction[proc, h]% - %%Partial correlation function and correlation function agree for lag of 1:
PartialCorrelationFunction[MAProcess[{a, b}, σ^2], 1]CorrelationFunction[MAProcess[{a, b}, σ^2], 1]% - %%//SimplifyFor an ARProcess:
PartialCorrelationFunction[ARProcess[{a, b}, σ^2], 1]CorrelationFunction[ARProcess[{a, b}, σ^2], 1]//Simplify% - %%//SimplifyPossible Issues (2)
Partial correlation function does not exist for non-weakly stationary processes:
PartialCorrelationFunction[ARProcess[{1, 2}, 1], 1]WeakStationarity[ARProcess[{1, 2}, 1]]Partial correlation function is not defined for zero time difference:
PartialCorrelationFunction[MAProcess[{a}, v], 0]Related Guides
History
Text
Wolfram Research (2012), PartialCorrelationFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/PartialCorrelationFunction.html.
CMS
Wolfram Language. 2012. "PartialCorrelationFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PartialCorrelationFunction.html.
APA
Wolfram Language. (2012). PartialCorrelationFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PartialCorrelationFunction.html
BibTeX
@misc{reference.wolfram_2026_partialcorrelationfunction, author="Wolfram Research", title="{PartialCorrelationFunction}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/PartialCorrelationFunction.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_partialcorrelationfunction, organization={Wolfram Research}, title={PartialCorrelationFunction}, year={2012}, url={https://reference.wolfram.com/language/ref/PartialCorrelationFunction.html}, note=[Accessed: 12-June-2026]}