def test_lpol2index_index2lpol(): process = ArmaProcess([1, 0, 0, -0.8]) coefs, locs = lpol2index(process.arcoefs) assert_almost_equal(coefs, [0.8]) assert_equal(locs, [2]) process = ArmaProcess([1, 0.1, 0.1, -0.8]) coefs, locs = lpol2index(process.arcoefs) assert_almost_equal(coefs, [-0.1, -0.1, 0.8]) assert_equal(locs, [0, 1, 2]) ar = index2lpol(coefs, locs) assert_equal(process.arcoefs, ar)
def test_lpol2index_index2lpol(): process = ArmaProcess([1, 0, 0, -0.8]) coefs, locs = lpol2index(process.arcoefs) assert_almost_equal(coefs, [0.8]) assert_equal(locs, [2]) process = ArmaProcess([1, .1, .1, -0.8]) coefs, locs = lpol2index(process.arcoefs) assert_almost_equal(coefs, [-.1, -.1, 0.8]) assert_equal(locs, [0, 1, 2]) ar = index2lpol(coefs, locs) assert_equal(process.arcoefs, ar)