Skip to content

Commit

Permalink
Merge 5c0e381 into c84ad54
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Oct 1, 2018
2 parents c84ad54 + 5c0e381 commit 23c8501
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 28 deletions.
50 changes: 25 additions & 25 deletions .travis.yml
Expand Up @@ -20,41 +20,41 @@ matrix:
include:
- python: 2.7
env:
- PYTHON=2.7
- USE_NUMBA=false
- MATPLOTLIB=2
- PYTHON=2.7
- NUMBA=0.35
- NUMPY=1.13
- SCIPY=0.19
- PANDAS=0.21
- COVERAGE=true
- python: 2.7
env:
- PYTHON=2.7
- NUMBA=0.35
- NUMPY=1.13
- SCIPY=0.19
- PANDAS=0.21
- COVERAGE=true
- PYTHON=3.7
- MATPLOTLIB=3
- COVERAGE=true
- python: 2.7
env:
- PYTHON=3.5
- COVERAGE=true
- MATPLOTLIB=2
- PYTHON=3.5
- COVERAGE=true
- MATPLOTLIB=2
- python: 2.7
env:
- PYTHON=3.6
- NUMBA=0.38
- NUMPY=1.14
- SCIPY=1.0
- MATPLOTLIB=2.0
- PANDAS=0.22
- STATSMODELS_MASTER=true
- PYTHON=3.6
- NUMBA=0.38
- NUMPY=1.14
- SCIPY=1.0
- MATPLOTLIB=2.0
- PANDAS=0.22
- STATSMODELS_MASTER=true
- python: 2.7
env:
- PYTHON=3.6
- DOCBUILD=true
- MATPLOTLIB=3
- PYTHON=2.7
- USE_NUMBA=false
- MATPLOTLIB=2
- python: 2.7
env:
- PYTHON=3.7
- MATPLOTLIB=3
- COVERAGE=true
- PYTHON=3.6
- DOCBUILD=true
- MATPLOTLIB=3

before_install:
- git fetch --tags
Expand Down
10 changes: 10 additions & 0 deletions arch/tests/univariate/test_base.py
@@ -0,0 +1,10 @@
from arch.univariate.base import format_float_fixed


def test_format_float_fixed():
out = format_float_fixed(0.0)
assert out == '0.0000'
out = format_float_fixed(1.23e-9)
assert out == '1.2300e-09'
out = format_float_fixed(123456789.0)
assert out == '1.2346e+08'
6 changes: 6 additions & 0 deletions arch/tests/univariate/test_mean.py
Expand Up @@ -385,6 +385,11 @@ def test_ar(self):
ar = ARX(self.y, lags=1, volatility=GARCH(), distribution=StudentsT())
res = ar.fit(disp=DISPLAY, update_freq=5, cov_type='mle')
res.param_cov
sims = res.forecast(horizon=5, method='simulation')
assert isinstance(sims.simulations.residual_variances, np.ndarray)
assert isinstance(sims.simulations.residuals, np.ndarray)
assert isinstance(sims.simulations.values, np.ndarray)
assert isinstance(sims.simulations.variances, np.ndarray)

def test_ar_no_lags(self):
ar = ARX(self.y, lags=0)
Expand All @@ -409,6 +414,7 @@ def test_ar_plot(self):
res.hedgehog_plot(start=500, type='mean')
res.hedgehog_plot(type='volatility')
res.hedgehog_plot(start=500, method='simulation', simulations=100)
res.hedgehog_plot(type='volatility', method='bootstrap')

def test_arch_arx(self):
self.rng.seed(12345)
Expand Down
6 changes: 3 additions & 3 deletions arch/univariate/base.py
Expand Up @@ -692,7 +692,7 @@ def forecast(self, params, horizon=1, start=None, align='origin', method='analyt
Returns
-------
forecasts : DataFrame
forecasts : ARCHModelForecast
t by h data frame containing the forecasts. The alignment of the
forecasts is controlled by `align`.
Expand Down Expand Up @@ -735,7 +735,7 @@ class _SummaryRepr(object):
"""Base class for returning summary as repr and str"""

def summary(self):
return Summary()
raise NotImplementedError("Subclasses must implement")

def __repr__(self):
out = self.__str__() + '\n'
Expand Down Expand Up @@ -1086,7 +1086,7 @@ def forecast(self, params=None, horizon=1, start=None, align='origin', method='a
Returns
-------
forecasts : DataFrame
forecasts : ARCHModelForecast
t by h data frame containing the forecasts. The alignment of the
forecasts is controlled by `align`.
Expand Down

0 comments on commit 23c8501

Please sign in to comment.