Repository navigation
ENH: Burgs algorithm - #5016
ENH: Burgs algorithm#5016
Conversation
|
Based on a quick pass this looks good. Only question: why does burg belong in linearmodel. (I have the same question about yulewalker...) |
|
Burg is an alternative to yule_walker since both estimate the parameters of
an AR1 and so should go in the same module.
…On Sat, Aug 25, 2018, 20:06 jbrockmendel ***@***.***> wrote:
Based on a quick pass this looks good. Only question: why does burg belong
in linearmodel. (I have the same question about yulewalker...)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5016 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFU5Reeo-zxfQ3YisvsxKc2OLKsA1Psyks5uUaAZgaJpZM4WMWJQ>
.
|
1a0bbef to
53f1f5e
Compare
| return np.array(pacf) | ||
|
|
||
|
|
||
| def pacf_burg(x, nlags=None, demean=True): |
There was a problem hiding this comment.
This name (pacf_burg) has a different structure from levinson_durbin_pacf, but of course they do different things w.r.t. the pacf. Just wanted to check that this was desired.
There was a problem hiding this comment.
The most comparable is pacf_yw which has signature def pacf_yw(x, nlags=40, method='unbiased') vs def pacf_burg(x, nlags=None, demean=True):
There is no sense of alternative methods here so that parameter makes no sense. nlags=None is the future of acf/pacf estimations (I have another PR that fixes this), and then 10*log10(nobs).
As for levinson_durbin vs lebinson_durbin_pacf, the interpretation of x depending another input is IMO a mistake. It should have one job -- convert acovf to arcoefs (and other stuff). This makes it clear that the user can choose their preferred pacf estimator before running LD, and LD_pacf doesn't need to know about all of the pacf estimators available.
|
|
||
|
|
||
| def pacf_burg(x, nlags=None, demean=True): | ||
| """ |
There was a problem hiding this comment.
Perhaps a one-line description?
| raise ValueError('nlags must be smaller than nobs - 1') | ||
| d = np.zeros(p + 1) | ||
| d[0] = 2 * x.dot(x) | ||
| phi = np.zeros(p + 1) |
There was a problem hiding this comment.
I don't know if we're still trying for descriptive naming, but could be arcoefs or something if we are.
|
Looks like a nice addition to me. Couple of small comments. |
Add Burg's method to compute the pacf Add Burg's AR estimator Add Levinson-Durbin for pacf->AR
Remove allocation of large matrices in Burg's pacf estimator
Add function that will convert pact to acf
Add Burg's method as ana alternatiive to Yule-Walker for pacf and AR estimation
Improve doc strings and variable names
53f1f5e to
ad4d0ee
Compare
|
Thanks! If you think it's ready to merge, I will do so tomorrow, unless there are concerns. |
Codecov Report
@@ Coverage Diff @@
## master #5016 +/- ##
==========================================
+ Coverage 81.45% 81.46% +0.01%
==========================================
Files 582 582
Lines 90116 90246 +130
Branches 10093 10106 +13
==========================================
+ Hits 73401 73522 +121
- Misses 14416 14422 +6
- Partials 2299 2302 +3
Continue to review full report at Codecov.
|
Ensure all paths are tested
|
@bashtage ready for merge? |
|
Yes |
|
Thanks @bashtage ! |
Add Burg's algorithm as an alternative to Yule-Walker for PACF, AR, and ACF estimation.