Skip to content

Commit bb05482

Browse files
authored
Merge pull request #140 from bashtage/finish-egarch-tests
TST: Add egarch and rm2006 tests
2 parents 51a187c + 610d9e8 commit bb05482

File tree

5 files changed

+413
-77
lines changed

5 files changed

+413
-77
lines changed

arch/bootstrap/tests/test_bootstrap.py

+14-18
Original file line numberDiff line numberDiff line change
@@ -234,24 +234,6 @@ def func(y):
234234
direct_cov = errors.T.dot(errors) / num_bootstrap
235235
assert_allclose(cov, direct_cov)
236236

237-
def test_smoke(self):
238-
# TODO: Upgrade to meaningful test
239-
num_bootstrap = 20
240-
241-
def func(y):
242-
return y.mean(axis=0)
243-
244-
bs = StationaryBootstrap(13, self.y)
245-
bs.cov(func, reps=num_bootstrap)
246-
bs = MovingBlockBootstrap(13, self.y)
247-
bs.cov(func, reps=num_bootstrap)
248-
bs = CircularBlockBootstrap(13, self.y)
249-
bs.cov(func, reps=num_bootstrap)
250-
bs = MovingBlockBootstrap(10, self.y)
251-
bs.cov(func, reps=num_bootstrap)
252-
bs = CircularBlockBootstrap(10, self.y)
253-
bs.cov(func, reps=num_bootstrap)
254-
255237
def test_conf_int_basic(self):
256238
num_bootstrap = 200
257239
bs = IIDBootstrap(self.x)
@@ -688,6 +670,20 @@ def test_str(self):
688670
' <strong>ID</strong>: ' + hex(id(bs)) + ')'
689671
assert_equal(bs._repr_html(), expected)
690672

673+
bs = MovingBlockBootstrap(block_size=20, y=self.y_series,
674+
x=self.x_df)
675+
expected = 'Moving Block Bootstrap(block size: 20, no. pos. ' \
676+
'inputs: 0, no. keyword inputs: 2)'
677+
assert_equal(str(bs), expected)
678+
expected = expected[:-1] + ', ID: ' + hex(id(bs)) + ')'
679+
assert_equal(bs.__repr__(), expected)
680+
expected = '<strong>Moving Block Bootstrap</strong>' + \
681+
'(<strong>block size</strong>: 20, ' \
682+
+ '<strong>no. pos. inputs</strong>: 0, ' + \
683+
'<strong>no. keyword inputs</strong>: 2,' + \
684+
' <strong>ID</strong>: ' + hex(id(bs)) + ')'
685+
assert_equal(bs._repr_html(), expected)
686+
691687
@pytest.mark.skipif(not HAS_EXTENSION, reason='Extension not built.')
692688
def test_samplers(self):
693689
"""

arch/bootstrap/tests/test_multiple_comparrison.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,7 @@ def max_step(losses, indices):
382382
direct.index.name = 'Model index'
383383
assert_frame_equal(mcs.pvalues.iloc[:m], direct)
384384

385-
def test_smoke(self):
386-
# TODO: Upgrade to meaningful test
387-
mcs = MCS(self.losses, 0.05, reps=100, block_size=10, method='max')
388-
mcs.compute()
385+
def test_output_types(self):
389386
mcs = MCS(self.losses_df, 0.05, reps=100, block_size=10, method='r')
390387
mcs.compute()
391388
assert_equal(type(mcs.included), list)

0 commit comments

Comments
 (0)