You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Strange behavior with pacf yule-walker unbiased #332
Should we guard against this here? This seems too strict and affects the others unless we can give some cutoff for the condition number or recode yule walker in some other way.
for order in orders:
r = np.zeros(order+1, np.float64)
r[0] = (X**2).sum() / denom(0)
for k in range(1,order+1):
r[k] = (X[0:-k]*X[k:]).sum() / denom(k)
R = toeplitz(r[:-1])
# guard against singular R
rcond = 1./np.linalg.cond(R) + np.finfo(float).eps
#rho = np.dot(np.linalg.pinv(R, rcond=rcond), r[1:])
rho = np.linalg.solve(R, r[1:])
print rho[-1]
I also wanted to add that in some cases, errors are caused because the "unbiased" method produces an autocovariance matrix that is not positive semidefinite. But it seems like this is not always the problem - sometimes the autocovariance matrix is positive definite, but numerical issues still result in autocorrelations > 1 and negative variances.
Activity
jseabold commentedon Jun 26, 2012
Oh...
Should we guard against this here? This seems too strict and affects the others unless we can give some cutoff for the condition number or recode yule walker in some other way.
jseabold commentedon May 1, 2013
Another problem with yule_walker. This might be do to a unit root though. Trying to figure out the problems in arima start_params.
Why is sigma a nan?
josef-pkt commentedon May 1, 2013
the data looks weird, what's the jump to 832 and 1536?
I didn't run it yet to look at the nan.
Main question: fail gracefully early on or try much harder.
There might be a Ridge version of yule_walker or the equivalent estimation with some penalization to "force" reasonable starting values, #15 #675
jseabold commentedon May 1, 2013
Definitely odd. I don't know the data, it was taken from the mailing list.
BUG: 2d 1 columns -> 1d. Closes statsmodels#332.
ChadFulton commentedon Mar 28, 2019
See also e.g. https://stackoverflow.com/questions/55252492/pacf-function-in-statsmodels-tsa-stattools-gives-numbers-greater-than-1-when-usi/55359388#55359388
I also wanted to add that in some cases, errors are caused because the "unbiased" method produces an autocovariance matrix that is not positive semidefinite. But it seems like this is not always the problem - sometimes the autocovariance matrix is positive definite, but numerical issues still result in autocorrelations > 1 and negative variances.