Skip to content

Commit

Permalink
CLN/TST: Improve arima_process
Browse files Browse the repository at this point in the history
Clean and test arima process functions
  • Loading branch information
bashtage committed Jun 23, 2016
1 parent f060948 commit 0c4dd42
Show file tree
Hide file tree
Showing 6 changed files with 542 additions and 422 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ exclude_lines =
if 0:
if __name__ == .__main__.:

omit =
# Test dirs
*/tests/*
*/test_*

# print_version
*/print_version.py

ignore_errors = False

[html]
Expand Down
28 changes: 27 additions & 1 deletion .travis_coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@

[run]
branch = True
include =
*/statsmodels/*

omit =
# Test dirs
*/tests/*
# Test files
*/test_*

# print_version
*/print_version.py

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
4 changes: 2 additions & 2 deletions statsmodels/sandbox/tsa/fftarma.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ def spdroots(self, w):
builds two arrays (number of roots, number of frequencies)
'''
return self.spdroots_(self.arroots, self.maroots, w)
return self._spdroots(self.arroots, self.maroots, w)

def spdroots_(self, arroots, maroots, w):
def _spdroots(self, arroots, maroots, w):
'''spectral density for frequency using polynomial roots
builds two arrays (number of roots, number of frequencies)
Expand Down
4 changes: 2 additions & 2 deletions statsmodels/tsa/arima_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ def predict(self, start=None, end=None, exog=None, dynamic=False):
def _forecast_error(self, steps):
sigma2 = self.sigma2
ma_rep = arma2ma(np.r_[1, -self.arparams],
np.r_[1, self.maparams], nobs=steps)
np.r_[1, self.maparams], lags=steps)

fcasterr = np.sqrt(sigma2 * np.cumsum(ma_rep**2))
return fcasterr
Expand Down Expand Up @@ -1780,7 +1780,7 @@ def predict(self, start=None, end=None, exog=None, typ='linear',
def _forecast_error(self, steps):
sigma2 = self.sigma2
ma_rep = arma2ma(np.r_[1, -self.arparams],
np.r_[1, self.maparams], nobs=steps)
np.r_[1, self.maparams], lags=steps)

fcerr = np.sqrt(np.cumsum(cumsum_n(ma_rep, self.k_diff)**2)*sigma2)
return fcerr
Expand Down

0 comments on commit 0c4dd42

Please sign in to comment.