Exemplo n.º 1
0
    def test_no_param_volatility(self):
        cm = ConstantMean(self.y)
        cm.volatility = EWMAVariance()
        cm.fit(update_freq=0)
        cm.volatility = RiskMetrics2006()
        cm.fit(update_freq=0)

        ar = ARX(self.y, lags=5)
        ar.volatility = EWMAVariance()
        ar.fit(update_freq=0)
        ar.volatility = RiskMetrics2006()
        ar.fit(update_freq=0)
Exemplo n.º 2
0
    def test_no_param_volatility(self):
        cm = ConstantMean(self.y)
        cm.volatility = EWMAVariance()
        cm.fit(update_freq=0)
        cm.volatility = RiskMetrics2006()
        cm.fit(update_freq=0)

        ar = ARX(self.y, lags=5)
        ar.volatility = EWMAVariance()
        ar.fit(update_freq=0)
        ar.volatility = RiskMetrics2006()
        ar.fit(update_freq=0)
Exemplo n.º 3
0
    def test_no_param_volatility(self):
        cm = ConstantMean(self.y)
        cm.volatility = EWMAVariance()
        cm.fit(update_freq=0, disp=DISPLAY)
        cm.volatility = RiskMetrics2006()
        cm.fit(update_freq=0, disp=DISPLAY)

        ar = ARX(self.y, lags=5)
        ar.volatility = EWMAVariance()
        ar.fit(update_freq=0, disp=DISPLAY)
        ar.volatility = RiskMetrics2006()
        ar.fit(update_freq=0, disp=DISPLAY)
        assert 'tau0' in str(ar.volatility)
        assert 'tau1' in str(ar.volatility)
        assert 'kmax' in str(ar.volatility)
Exemplo n.º 4
0
    def test_no_param_volatility(self):
        cm = ConstantMean(self.y)
        cm.volatility = EWMAVariance()
        cm.fit(update_freq=0, disp=DISPLAY)
        cm.volatility = RiskMetrics2006()
        cm.fit(update_freq=0, disp=DISPLAY)

        ar = ARX(self.y, lags=5)
        ar.volatility = EWMAVariance()
        ar.fit(update_freq=0, disp=DISPLAY)
        ar.volatility = RiskMetrics2006()
        ar.fit(update_freq=0, disp=DISPLAY)
        assert 'tau0' in str(ar.volatility)
        assert 'tau1' in str(ar.volatility)
        assert 'kmax' in str(ar.volatility)
Exemplo n.º 5
0
 def test_egarch(self):
     cm = ConstantMean(self.y)
     cm.volatility = EGARCH()
     res = cm.fit(update_freq=0, disp=DISPLAY)
     summ = res.summary()
     assert "Df Model:                            1" in str(summ)
     cm.distribution = StudentsT()
     cm.fit(update_freq=0, disp=DISPLAY)
Exemplo n.º 6
0
 def test_multiple_lags(self):
     """Smoke test to ensure models estimate with multiple lags"""
     vp = {"garch": GARCH, "egarch": EGARCH, "harch": HARCH, "arch": ARCH}
     cm = ConstantMean(self.y)
     for name, process in vp.items():
         cm.volatility = process()
         cm.fit(update_freq=0, disp=DISPLAY)
         for p in [1, 2, 3]:
             for o in [1, 2, 3]:
                 for q in [1, 2, 3]:
                     if name in ("arch",):
                         cm.volatility = process(p=p + o + q)
                         cm.fit(update_freq=0, disp=DISPLAY)
                     elif name in ("harch",):
                         cm.volatility = process(lags=[p, p + o, p + o + q])
                         cm.fit(update_freq=0, disp=DISPLAY)
                     else:
                         cm.volatility = process(p=p, o=o, q=q)
                         cm.fit(update_freq=0, disp=DISPLAY)
Exemplo n.º 7
0
 def test_multiple_lags(self):
     """Smoke test to ensure models estimate with multiple lags"""
     vp = {'garch': GARCH, 'egarch': EGARCH, 'harch': HARCH, 'arch': ARCH}
     cm = ConstantMean(self.y)
     for name, process in iteritems(vp):
         cm.volatility = process()
         cm.fit(update_freq=0, disp='off')
         for p in [1, 2, 3]:
             for o in [1, 2, 3]:
                 for q in [1, 2, 3]:
                     if name in ('arch', ):
                         cm.volatility = process(p=p + o + q)
                         cm.fit(update_freq=0, disp='off')
                     elif name in ('harch', ):
                         cm.volatility = process(lags=[p, p + o, p + o + q])
                         cm.fit(update_freq=0, disp='off')
                     else:
                         cm.volatility = process(p=p, o=o, q=q)
                         cm.fit(update_freq=0, disp='off')
Exemplo n.º 8
0
 def test_multiple_lags(self):
     """Smoke test to ensure models estimate with multiple lags"""
     vp = {'garch': GARCH,
           'egarch': EGARCH,
           'harch': HARCH,
           'arch': ARCH}
     cm = ConstantMean(self.y)
     for name, process in iteritems(vp):
         cm.volatility = process()
         cm.fit(update_freq=0, disp='off')
         for p in [1, 2, 3]:
             for o in [1, 2, 3]:
                 for q in [1, 2, 3]:
                     if name in ('arch',):
                         cm.volatility = process(p=p + o + q)
                         cm.fit(update_freq=0, disp='off')
                     elif name in ('harch',):
                         cm.volatility = process(lags=[p, p + o, p + o + q])
                         cm.fit(update_freq=0, disp='off')
                     else:
                         cm.volatility = process(p=p, o=o, q=q)
                         cm.fit(update_freq=0, disp='off')
Exemplo n.º 9
0
 def test_egarch(self):
     cm = ConstantMean(self.y)
     cm.volatility = EGARCH()
     cm.fit(update_freq=0, disp=DISPLAY)
     cm.distribution = StudentsT()
     cm.fit(update_freq=0, disp=DISPLAY)
Exemplo n.º 10
0
 def test_egarch(self):
     cm = ConstantMean(self.y)
     cm.volatility = EGARCH()
     cm.fit(update_freq=0, disp=DISPLAY)
     cm.distribution = StudentsT()
     cm.fit(update_freq=0, disp=DISPLAY)