Repository navigation
BUG/TST: Fix innovations_filter, add test vs Kalman filter - #5325
Merged
Merged
Conversation
ChadFulton
commented
Oct 17, 2018
| if not isinstance(rtol, float): | ||
| raise ValueError('rtol must be a non-negative float or None.') | ||
| n = acov.shape[0] if nobs is None else int(nobs) | ||
| if n != nobs or nobs < 1: |
Member
Author
There was a problem hiding this comment.
Had to change this, since n != nobs is always true if nobs is not explicitly set.
bashtage
reviewed
Oct 18, 2018
| else: | ||
| hat = (theta[i] * u[i - k:i][::-1]).sum() | ||
| u[i] = endog[i] + hat | ||
| u[i] = endog[i] - hat |
Member
There was a problem hiding this comment.
These look right. Surprised I missed that
bashtage
reviewed
Oct 18, 2018
| expected = [endog[0]] | ||
| for i in range(1, 4): | ||
| expected.append(endog[i] + theta[i, 0] * expected[-1]) | ||
| expected.append(endog[i] - theta[i, 0] * expected[-1]) |
Member
There was a problem hiding this comment.
I guess repeating the same typo is how
Member
Author
|
One other question before I merge this - the general innovations algorithm in Brockwell and Davis allows for non-stationary input - i.e. where covariances change over time, but if I'm reading the function right, I guess it assumes that the process is stationary? If so I guess we should add that to the documentation. |
Member
Author
|
Well I'll merge this now, and we can improve the documentation later if necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes two bugs in
tsa.stattools.innovation_filterand adds a more comprehensive unit test versus Kalman filter output.@bashtage would be happy for your thoughts.