PACF function in statsmodels.tsa.stattools gives numbers greater than 1 when using ywunbiased?How to flush output of print function?Is everything greater than None?Is there a built-in function for finding the mode?Is there a greater than but less than function in python?Why is statsmodels select_order function different from params for AR model?Fitting transformed functions with OLSStats Models Logit().fit() function throwing an error LinAlgError: Singular matrixPython seasonal_decompose function from Statsmodels library giving ValueErrorDoes PACF plot shows the values greater than 1 or less than -1?Why does not ACF and PACF graphs function with ggplot?
Why don't electromagnetic waves interact with each other?
The magic money tree problem
Pronouncing Dictionary.com's W.O.D "vade mecum" in English
A Journey Through Space and Time
Prevent a directory in /tmp from being deleted
Is there a familial term for apples and pears?
Why CLRS example on residual networks does not follows its formula?
Patience, young "Padovan"
The use of multiple foreign keys on same column in SQL Server
Can a German sentence have two subjects?
How to make payment on the internet without leaving a money trail?
Why is the design of haulage companies so “special”?
How to type dʒ symbol (IPA) on Mac?
Why is "Reports" in sentence down without "The"
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
How can I fix this gap between bookcases I made?
Email Account under attack (really) - anything I can do?
Should I join office cleaning event for free?
Why is an old chain unsafe?
Why are 150k or 200k jobs considered good when there are 300k+ births a month?
Set-theoretical foundations of Mathematics with only bounded quantifiers
Why are only specific transaction types accepted into the mempool?
Is there really no realistic way for a skeleton monster to move around without magic?
How can bays and straits be determined in a procedurally generated map?
PACF function in statsmodels.tsa.stattools gives numbers greater than 1 when using ywunbiased?
How to flush output of print function?Is everything greater than None?Is there a built-in function for finding the mode?Is there a greater than but less than function in python?Why is statsmodels select_order function different from params for AR model?Fitting transformed functions with OLSStats Models Logit().fit() function throwing an error LinAlgError: Singular matrixPython seasonal_decompose function from Statsmodels library giving ValueErrorDoes PACF plot shows the values greater than 1 or less than -1?Why does not ACF and PACF graphs function with ggplot?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a dataframe which is of length 177 and I want to calculate and plot the partial auto-correlation function (PACF).
I have the data imported etc and I do:
from statsmodels.tsa.stattools import pacf
ys = pacf(data[key][array].diff(1).dropna(), alpha=0.05, nlags=176, method="ywunbiased")
xs = range(lags+1)
plt.figure()
plt.scatter(xs,ys[0])
plt.grid()
plt.vlines(xs, 0, ys[0])
plt.plot(ys[1])
The method used results in numbers greater than 1 for very long lags (90ish) which is incorrect and I get a RuntimeWarning: invalid value encountered in sqrtreturn rho, np.sqrt(sigmasq) but since I can't see their source code I don't know what this means.
To be honest, when I search for PACF, all the examples only carry out PACF up to 40 lags or 60 or so and they never have any significant PACF after lag=2 and so I couldn't compare to other examples either.
But when I use:
method="ols"
# or
method="ywmle"
the numbers are corrected. So it must be the algo they use to solve it.
I tried importing inspect and getsource method but its useless it just shows that it uses another package and I can't find that.
If you also know where the problem arises from, I would really appreciate the help.
For your reference, the values for data[key][array] are:
[1131.130005, 1144.939941, 1126.209961, 1107.300049, 1120.680054, 1140.839966, 1101.719971, 1104.23999, 1114.579956, 1130.199951, 1173.819946, 1211.920044, 1181.27002, 1203.599976, 1180.589966, 1156.849976, 1191.5, 1191.329956, 1234.180054, 1220.329956, 1228.810059, 1207.01001, 1249.47998, 1248.290039, 1280.079956, 1280.660034, 1294.869995, 1310.609985, 1270.089966, 1270.199951, 1276.660034, 1303.819946, 1335.849976, 1377.939941, 1400.630005, 1418.300049, 1438.23999, 1406.819946, 1420.859985, 1482.369995, 1530.619995, 1503.349976, 1455.27002, 1473.98999, 1526.75, 1549.380005, 1481.140015, 1468.359985, 1378.550049, 1330.630005, 1322.699951, 1385.589966, 1400.380005, 1280.0, 1267.380005, 1282.829956, 1166.359985, 968.75, 896.23999, 903.25, 825.880005, 735.090027, 797.869995, 872.8099980000001, 919.1400150000001, 919.320007, 987.4799800000001, 1020.6199949999999, 1057.079956, 1036.189941, 1095.630005, 1115.099976, 1073.869995, 1104.48999, 1169.430054, 1186.689941, 1089.410034, 1030.709961, 1101.599976, 1049.329956, 1141.199951, 1183.26001, 1180.550049, 1257.640015, 1286.119995, 1327.219971, 1325.829956, 1363.609985, 1345.199951, 1320.640015, 1292.280029, 1218.890015, 1131.420044, 1253.300049, 1246.959961, 1257.599976, 1312.410034, 1365.680054, 1408.469971, 1397.910034, 1310.329956, 1362.160034, 1379.319946, 1406.579956, 1440.670044, 1412.160034, 1416.180054, 1426.189941, 1498.109985, 1514.680054, 1569.189941, 1597.569946, 1630.73999, 1606.280029, 1685.72998, 1632.969971, 1681.550049, 1756.540039, 1805.810059, 1848.359985, 1782.589966, 1859.449951, 1872.339966, 1883.949951, 1923.569946, 1960.22998, 1930.6700440000002, 2003.369995, 1972.290039, 2018.050049, 2067.560059, 2058.899902, 1994.9899899999998, 2104.5, 2067.889893, 2085.51001, 2107.389893, 2063.110107, 2103.840088, 1972.180054, 1920.030029, 2079.360107, 2080.409912, 2043.939941, 1940.2399899999998, 1932.22998, 2059.73999, 2065.300049, 2096.949951, 2098.860107, 2173.600098, 2170.949951, 2168.27002, 2126.149902, 2198.810059, 2238.830078, 2278.8701170000004, 2363.639893, 2362.719971, 2384.199951, 2411.800049, 2423.409912, 2470.300049, 2471.649902, 2519.360107, 2575.26001, 2584.840088, 2673.610107, 2823.810059, 2713.830078, 2640.8701170000004, 2648.050049, 2705.27002, 2718.3701170000004, 2816.290039, 2901.52002, 2913.97998]
python-3.x statistics time-series statsmodels
add a comment |
I have a dataframe which is of length 177 and I want to calculate and plot the partial auto-correlation function (PACF).
I have the data imported etc and I do:
from statsmodels.tsa.stattools import pacf
ys = pacf(data[key][array].diff(1).dropna(), alpha=0.05, nlags=176, method="ywunbiased")
xs = range(lags+1)
plt.figure()
plt.scatter(xs,ys[0])
plt.grid()
plt.vlines(xs, 0, ys[0])
plt.plot(ys[1])
The method used results in numbers greater than 1 for very long lags (90ish) which is incorrect and I get a RuntimeWarning: invalid value encountered in sqrtreturn rho, np.sqrt(sigmasq) but since I can't see their source code I don't know what this means.
To be honest, when I search for PACF, all the examples only carry out PACF up to 40 lags or 60 or so and they never have any significant PACF after lag=2 and so I couldn't compare to other examples either.
But when I use:
method="ols"
# or
method="ywmle"
the numbers are corrected. So it must be the algo they use to solve it.
I tried importing inspect and getsource method but its useless it just shows that it uses another package and I can't find that.
If you also know where the problem arises from, I would really appreciate the help.
For your reference, the values for data[key][array] are:
[1131.130005, 1144.939941, 1126.209961, 1107.300049, 1120.680054, 1140.839966, 1101.719971, 1104.23999, 1114.579956, 1130.199951, 1173.819946, 1211.920044, 1181.27002, 1203.599976, 1180.589966, 1156.849976, 1191.5, 1191.329956, 1234.180054, 1220.329956, 1228.810059, 1207.01001, 1249.47998, 1248.290039, 1280.079956, 1280.660034, 1294.869995, 1310.609985, 1270.089966, 1270.199951, 1276.660034, 1303.819946, 1335.849976, 1377.939941, 1400.630005, 1418.300049, 1438.23999, 1406.819946, 1420.859985, 1482.369995, 1530.619995, 1503.349976, 1455.27002, 1473.98999, 1526.75, 1549.380005, 1481.140015, 1468.359985, 1378.550049, 1330.630005, 1322.699951, 1385.589966, 1400.380005, 1280.0, 1267.380005, 1282.829956, 1166.359985, 968.75, 896.23999, 903.25, 825.880005, 735.090027, 797.869995, 872.8099980000001, 919.1400150000001, 919.320007, 987.4799800000001, 1020.6199949999999, 1057.079956, 1036.189941, 1095.630005, 1115.099976, 1073.869995, 1104.48999, 1169.430054, 1186.689941, 1089.410034, 1030.709961, 1101.599976, 1049.329956, 1141.199951, 1183.26001, 1180.550049, 1257.640015, 1286.119995, 1327.219971, 1325.829956, 1363.609985, 1345.199951, 1320.640015, 1292.280029, 1218.890015, 1131.420044, 1253.300049, 1246.959961, 1257.599976, 1312.410034, 1365.680054, 1408.469971, 1397.910034, 1310.329956, 1362.160034, 1379.319946, 1406.579956, 1440.670044, 1412.160034, 1416.180054, 1426.189941, 1498.109985, 1514.680054, 1569.189941, 1597.569946, 1630.73999, 1606.280029, 1685.72998, 1632.969971, 1681.550049, 1756.540039, 1805.810059, 1848.359985, 1782.589966, 1859.449951, 1872.339966, 1883.949951, 1923.569946, 1960.22998, 1930.6700440000002, 2003.369995, 1972.290039, 2018.050049, 2067.560059, 2058.899902, 1994.9899899999998, 2104.5, 2067.889893, 2085.51001, 2107.389893, 2063.110107, 2103.840088, 1972.180054, 1920.030029, 2079.360107, 2080.409912, 2043.939941, 1940.2399899999998, 1932.22998, 2059.73999, 2065.300049, 2096.949951, 2098.860107, 2173.600098, 2170.949951, 2168.27002, 2126.149902, 2198.810059, 2238.830078, 2278.8701170000004, 2363.639893, 2362.719971, 2384.199951, 2411.800049, 2423.409912, 2470.300049, 2471.649902, 2519.360107, 2575.26001, 2584.840088, 2673.610107, 2823.810059, 2713.830078, 2640.8701170000004, 2648.050049, 2705.27002, 2718.3701170000004, 2816.290039, 2901.52002, 2913.97998]
python-3.x statistics time-series statsmodels
1
Could you put somewhere 1d array of input data?
– Severin Pappadeux
Mar 20 at 2:10
@SeverinPappadeux Sorry for the delayed response. I added the data. Thanks for looking into this :)
– Shervin Rad
Mar 22 at 0:38
add a comment |
I have a dataframe which is of length 177 and I want to calculate and plot the partial auto-correlation function (PACF).
I have the data imported etc and I do:
from statsmodels.tsa.stattools import pacf
ys = pacf(data[key][array].diff(1).dropna(), alpha=0.05, nlags=176, method="ywunbiased")
xs = range(lags+1)
plt.figure()
plt.scatter(xs,ys[0])
plt.grid()
plt.vlines(xs, 0, ys[0])
plt.plot(ys[1])
The method used results in numbers greater than 1 for very long lags (90ish) which is incorrect and I get a RuntimeWarning: invalid value encountered in sqrtreturn rho, np.sqrt(sigmasq) but since I can't see their source code I don't know what this means.
To be honest, when I search for PACF, all the examples only carry out PACF up to 40 lags or 60 or so and they never have any significant PACF after lag=2 and so I couldn't compare to other examples either.
But when I use:
method="ols"
# or
method="ywmle"
the numbers are corrected. So it must be the algo they use to solve it.
I tried importing inspect and getsource method but its useless it just shows that it uses another package and I can't find that.
If you also know where the problem arises from, I would really appreciate the help.
For your reference, the values for data[key][array] are:
[1131.130005, 1144.939941, 1126.209961, 1107.300049, 1120.680054, 1140.839966, 1101.719971, 1104.23999, 1114.579956, 1130.199951, 1173.819946, 1211.920044, 1181.27002, 1203.599976, 1180.589966, 1156.849976, 1191.5, 1191.329956, 1234.180054, 1220.329956, 1228.810059, 1207.01001, 1249.47998, 1248.290039, 1280.079956, 1280.660034, 1294.869995, 1310.609985, 1270.089966, 1270.199951, 1276.660034, 1303.819946, 1335.849976, 1377.939941, 1400.630005, 1418.300049, 1438.23999, 1406.819946, 1420.859985, 1482.369995, 1530.619995, 1503.349976, 1455.27002, 1473.98999, 1526.75, 1549.380005, 1481.140015, 1468.359985, 1378.550049, 1330.630005, 1322.699951, 1385.589966, 1400.380005, 1280.0, 1267.380005, 1282.829956, 1166.359985, 968.75, 896.23999, 903.25, 825.880005, 735.090027, 797.869995, 872.8099980000001, 919.1400150000001, 919.320007, 987.4799800000001, 1020.6199949999999, 1057.079956, 1036.189941, 1095.630005, 1115.099976, 1073.869995, 1104.48999, 1169.430054, 1186.689941, 1089.410034, 1030.709961, 1101.599976, 1049.329956, 1141.199951, 1183.26001, 1180.550049, 1257.640015, 1286.119995, 1327.219971, 1325.829956, 1363.609985, 1345.199951, 1320.640015, 1292.280029, 1218.890015, 1131.420044, 1253.300049, 1246.959961, 1257.599976, 1312.410034, 1365.680054, 1408.469971, 1397.910034, 1310.329956, 1362.160034, 1379.319946, 1406.579956, 1440.670044, 1412.160034, 1416.180054, 1426.189941, 1498.109985, 1514.680054, 1569.189941, 1597.569946, 1630.73999, 1606.280029, 1685.72998, 1632.969971, 1681.550049, 1756.540039, 1805.810059, 1848.359985, 1782.589966, 1859.449951, 1872.339966, 1883.949951, 1923.569946, 1960.22998, 1930.6700440000002, 2003.369995, 1972.290039, 2018.050049, 2067.560059, 2058.899902, 1994.9899899999998, 2104.5, 2067.889893, 2085.51001, 2107.389893, 2063.110107, 2103.840088, 1972.180054, 1920.030029, 2079.360107, 2080.409912, 2043.939941, 1940.2399899999998, 1932.22998, 2059.73999, 2065.300049, 2096.949951, 2098.860107, 2173.600098, 2170.949951, 2168.27002, 2126.149902, 2198.810059, 2238.830078, 2278.8701170000004, 2363.639893, 2362.719971, 2384.199951, 2411.800049, 2423.409912, 2470.300049, 2471.649902, 2519.360107, 2575.26001, 2584.840088, 2673.610107, 2823.810059, 2713.830078, 2640.8701170000004, 2648.050049, 2705.27002, 2718.3701170000004, 2816.290039, 2901.52002, 2913.97998]
python-3.x statistics time-series statsmodels
I have a dataframe which is of length 177 and I want to calculate and plot the partial auto-correlation function (PACF).
I have the data imported etc and I do:
from statsmodels.tsa.stattools import pacf
ys = pacf(data[key][array].diff(1).dropna(), alpha=0.05, nlags=176, method="ywunbiased")
xs = range(lags+1)
plt.figure()
plt.scatter(xs,ys[0])
plt.grid()
plt.vlines(xs, 0, ys[0])
plt.plot(ys[1])
The method used results in numbers greater than 1 for very long lags (90ish) which is incorrect and I get a RuntimeWarning: invalid value encountered in sqrtreturn rho, np.sqrt(sigmasq) but since I can't see their source code I don't know what this means.
To be honest, when I search for PACF, all the examples only carry out PACF up to 40 lags or 60 or so and they never have any significant PACF after lag=2 and so I couldn't compare to other examples either.
But when I use:
method="ols"
# or
method="ywmle"
the numbers are corrected. So it must be the algo they use to solve it.
I tried importing inspect and getsource method but its useless it just shows that it uses another package and I can't find that.
If you also know where the problem arises from, I would really appreciate the help.
For your reference, the values for data[key][array] are:
[1131.130005, 1144.939941, 1126.209961, 1107.300049, 1120.680054, 1140.839966, 1101.719971, 1104.23999, 1114.579956, 1130.199951, 1173.819946, 1211.920044, 1181.27002, 1203.599976, 1180.589966, 1156.849976, 1191.5, 1191.329956, 1234.180054, 1220.329956, 1228.810059, 1207.01001, 1249.47998, 1248.290039, 1280.079956, 1280.660034, 1294.869995, 1310.609985, 1270.089966, 1270.199951, 1276.660034, 1303.819946, 1335.849976, 1377.939941, 1400.630005, 1418.300049, 1438.23999, 1406.819946, 1420.859985, 1482.369995, 1530.619995, 1503.349976, 1455.27002, 1473.98999, 1526.75, 1549.380005, 1481.140015, 1468.359985, 1378.550049, 1330.630005, 1322.699951, 1385.589966, 1400.380005, 1280.0, 1267.380005, 1282.829956, 1166.359985, 968.75, 896.23999, 903.25, 825.880005, 735.090027, 797.869995, 872.8099980000001, 919.1400150000001, 919.320007, 987.4799800000001, 1020.6199949999999, 1057.079956, 1036.189941, 1095.630005, 1115.099976, 1073.869995, 1104.48999, 1169.430054, 1186.689941, 1089.410034, 1030.709961, 1101.599976, 1049.329956, 1141.199951, 1183.26001, 1180.550049, 1257.640015, 1286.119995, 1327.219971, 1325.829956, 1363.609985, 1345.199951, 1320.640015, 1292.280029, 1218.890015, 1131.420044, 1253.300049, 1246.959961, 1257.599976, 1312.410034, 1365.680054, 1408.469971, 1397.910034, 1310.329956, 1362.160034, 1379.319946, 1406.579956, 1440.670044, 1412.160034, 1416.180054, 1426.189941, 1498.109985, 1514.680054, 1569.189941, 1597.569946, 1630.73999, 1606.280029, 1685.72998, 1632.969971, 1681.550049, 1756.540039, 1805.810059, 1848.359985, 1782.589966, 1859.449951, 1872.339966, 1883.949951, 1923.569946, 1960.22998, 1930.6700440000002, 2003.369995, 1972.290039, 2018.050049, 2067.560059, 2058.899902, 1994.9899899999998, 2104.5, 2067.889893, 2085.51001, 2107.389893, 2063.110107, 2103.840088, 1972.180054, 1920.030029, 2079.360107, 2080.409912, 2043.939941, 1940.2399899999998, 1932.22998, 2059.73999, 2065.300049, 2096.949951, 2098.860107, 2173.600098, 2170.949951, 2168.27002, 2126.149902, 2198.810059, 2238.830078, 2278.8701170000004, 2363.639893, 2362.719971, 2384.199951, 2411.800049, 2423.409912, 2470.300049, 2471.649902, 2519.360107, 2575.26001, 2584.840088, 2673.610107, 2823.810059, 2713.830078, 2640.8701170000004, 2648.050049, 2705.27002, 2718.3701170000004, 2816.290039, 2901.52002, 2913.97998]
python-3.x statistics time-series statsmodels
python-3.x statistics time-series statsmodels
edited Mar 25 at 13:32
Shervin Rad
asked Mar 20 at 2:01
Shervin RadShervin Rad
6810
6810
1
Could you put somewhere 1d array of input data?
– Severin Pappadeux
Mar 20 at 2:10
@SeverinPappadeux Sorry for the delayed response. I added the data. Thanks for looking into this :)
– Shervin Rad
Mar 22 at 0:38
add a comment |
1
Could you put somewhere 1d array of input data?
– Severin Pappadeux
Mar 20 at 2:10
@SeverinPappadeux Sorry for the delayed response. I added the data. Thanks for looking into this :)
– Shervin Rad
Mar 22 at 0:38
1
1
Could you put somewhere 1d array of input data?
– Severin Pappadeux
Mar 20 at 2:10
Could you put somewhere 1d array of input data?
– Severin Pappadeux
Mar 20 at 2:10
@SeverinPappadeux Sorry for the delayed response. I added the data. Thanks for looking into this :)
– Shervin Rad
Mar 22 at 0:38
@SeverinPappadeux Sorry for the delayed response. I added the data. Thanks for looking into this :)
– Shervin Rad
Mar 22 at 0:38
add a comment |
1 Answer
1
active
oldest
votes
Your time series is pretty clearly not stationary, so that Yule-Walker assumptions are violated.
More generally, PACF is usually appropriate with stationary time series. You might difference your data first, before considering the partial autocorrelations.
I differenced the series once and to make sure I carried out an ADF test and it showed no unit root but I still got the same problem. I differenced it twice just to make sure and still the same results. Also, I don't see any seasonality but I still took a moving average as well to cover that base. Also tried OLS as well but that too gives values over 1 :'(((((( Any ideas?
– Shervin Rad
Mar 27 at 1:38
1
You're right. I suppose that the problem may be that there are relatively few datapoints being used to compute these values for lags that long, and so the estimates are numerically not very stable. It's possible that the other methods are slightly less prone to numerical problems, or maybe they just don't run into trouble here. In any case, I would not put too much weight on any partial autocorrelation value for very long lags.
– cfulton
Mar 27 at 13:29
1
Just to add a reference, Enders (2014) suggests that with sample size T, the PACF should only be computed up to lags T / 4. Since you have 176 datapoints, this rule of thumb would suggest not considering the PACF for lags greater than 44.
– cfulton
Mar 28 at 14:27
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55252492%2fpacf-function-in-statsmodels-tsa-stattools-gives-numbers-greater-than-1-when-usi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your time series is pretty clearly not stationary, so that Yule-Walker assumptions are violated.
More generally, PACF is usually appropriate with stationary time series. You might difference your data first, before considering the partial autocorrelations.
I differenced the series once and to make sure I carried out an ADF test and it showed no unit root but I still got the same problem. I differenced it twice just to make sure and still the same results. Also, I don't see any seasonality but I still took a moving average as well to cover that base. Also tried OLS as well but that too gives values over 1 :'(((((( Any ideas?
– Shervin Rad
Mar 27 at 1:38
1
You're right. I suppose that the problem may be that there are relatively few datapoints being used to compute these values for lags that long, and so the estimates are numerically not very stable. It's possible that the other methods are slightly less prone to numerical problems, or maybe they just don't run into trouble here. In any case, I would not put too much weight on any partial autocorrelation value for very long lags.
– cfulton
Mar 27 at 13:29
1
Just to add a reference, Enders (2014) suggests that with sample size T, the PACF should only be computed up to lags T / 4. Since you have 176 datapoints, this rule of thumb would suggest not considering the PACF for lags greater than 44.
– cfulton
Mar 28 at 14:27
add a comment |
Your time series is pretty clearly not stationary, so that Yule-Walker assumptions are violated.
More generally, PACF is usually appropriate with stationary time series. You might difference your data first, before considering the partial autocorrelations.
I differenced the series once and to make sure I carried out an ADF test and it showed no unit root but I still got the same problem. I differenced it twice just to make sure and still the same results. Also, I don't see any seasonality but I still took a moving average as well to cover that base. Also tried OLS as well but that too gives values over 1 :'(((((( Any ideas?
– Shervin Rad
Mar 27 at 1:38
1
You're right. I suppose that the problem may be that there are relatively few datapoints being used to compute these values for lags that long, and so the estimates are numerically not very stable. It's possible that the other methods are slightly less prone to numerical problems, or maybe they just don't run into trouble here. In any case, I would not put too much weight on any partial autocorrelation value for very long lags.
– cfulton
Mar 27 at 13:29
1
Just to add a reference, Enders (2014) suggests that with sample size T, the PACF should only be computed up to lags T / 4. Since you have 176 datapoints, this rule of thumb would suggest not considering the PACF for lags greater than 44.
– cfulton
Mar 28 at 14:27
add a comment |
Your time series is pretty clearly not stationary, so that Yule-Walker assumptions are violated.
More generally, PACF is usually appropriate with stationary time series. You might difference your data first, before considering the partial autocorrelations.
Your time series is pretty clearly not stationary, so that Yule-Walker assumptions are violated.
More generally, PACF is usually appropriate with stationary time series. You might difference your data first, before considering the partial autocorrelations.
answered Mar 26 at 14:19
cfultoncfulton
45124
45124
I differenced the series once and to make sure I carried out an ADF test and it showed no unit root but I still got the same problem. I differenced it twice just to make sure and still the same results. Also, I don't see any seasonality but I still took a moving average as well to cover that base. Also tried OLS as well but that too gives values over 1 :'(((((( Any ideas?
– Shervin Rad
Mar 27 at 1:38
1
You're right. I suppose that the problem may be that there are relatively few datapoints being used to compute these values for lags that long, and so the estimates are numerically not very stable. It's possible that the other methods are slightly less prone to numerical problems, or maybe they just don't run into trouble here. In any case, I would not put too much weight on any partial autocorrelation value for very long lags.
– cfulton
Mar 27 at 13:29
1
Just to add a reference, Enders (2014) suggests that with sample size T, the PACF should only be computed up to lags T / 4. Since you have 176 datapoints, this rule of thumb would suggest not considering the PACF for lags greater than 44.
– cfulton
Mar 28 at 14:27
add a comment |
I differenced the series once and to make sure I carried out an ADF test and it showed no unit root but I still got the same problem. I differenced it twice just to make sure and still the same results. Also, I don't see any seasonality but I still took a moving average as well to cover that base. Also tried OLS as well but that too gives values over 1 :'(((((( Any ideas?
– Shervin Rad
Mar 27 at 1:38
1
You're right. I suppose that the problem may be that there are relatively few datapoints being used to compute these values for lags that long, and so the estimates are numerically not very stable. It's possible that the other methods are slightly less prone to numerical problems, or maybe they just don't run into trouble here. In any case, I would not put too much weight on any partial autocorrelation value for very long lags.
– cfulton
Mar 27 at 13:29
1
Just to add a reference, Enders (2014) suggests that with sample size T, the PACF should only be computed up to lags T / 4. Since you have 176 datapoints, this rule of thumb would suggest not considering the PACF for lags greater than 44.
– cfulton
Mar 28 at 14:27
I differenced the series once and to make sure I carried out an ADF test and it showed no unit root but I still got the same problem. I differenced it twice just to make sure and still the same results. Also, I don't see any seasonality but I still took a moving average as well to cover that base. Also tried OLS as well but that too gives values over 1 :'(((((( Any ideas?
– Shervin Rad
Mar 27 at 1:38
I differenced the series once and to make sure I carried out an ADF test and it showed no unit root but I still got the same problem. I differenced it twice just to make sure and still the same results. Also, I don't see any seasonality but I still took a moving average as well to cover that base. Also tried OLS as well but that too gives values over 1 :'(((((( Any ideas?
– Shervin Rad
Mar 27 at 1:38
1
1
You're right. I suppose that the problem may be that there are relatively few datapoints being used to compute these values for lags that long, and so the estimates are numerically not very stable. It's possible that the other methods are slightly less prone to numerical problems, or maybe they just don't run into trouble here. In any case, I would not put too much weight on any partial autocorrelation value for very long lags.
– cfulton
Mar 27 at 13:29
You're right. I suppose that the problem may be that there are relatively few datapoints being used to compute these values for lags that long, and so the estimates are numerically not very stable. It's possible that the other methods are slightly less prone to numerical problems, or maybe they just don't run into trouble here. In any case, I would not put too much weight on any partial autocorrelation value for very long lags.
– cfulton
Mar 27 at 13:29
1
1
Just to add a reference, Enders (2014) suggests that with sample size T, the PACF should only be computed up to lags T / 4. Since you have 176 datapoints, this rule of thumb would suggest not considering the PACF for lags greater than 44.
– cfulton
Mar 28 at 14:27
Just to add a reference, Enders (2014) suggests that with sample size T, the PACF should only be computed up to lags T / 4. Since you have 176 datapoints, this rule of thumb would suggest not considering the PACF for lags greater than 44.
– cfulton
Mar 28 at 14:27
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55252492%2fpacf-function-in-statsmodels-tsa-stattools-gives-numbers-greater-than-1-when-usi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Could you put somewhere 1d array of input data?
– Severin Pappadeux
Mar 20 at 2:10
@SeverinPappadeux Sorry for the delayed response. I added the data. Thanks for looking into this :)
– Shervin Rad
Mar 22 at 0:38