<commit_before>"""
Tests for SARIMAX models

Author: <NAME>
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function

import numpy as np
import os

from statsmodels.tsa.statespace import sarimax
from .results import results_sarimax
from statsmodels.tools import add_constant
from numpy.testing import assert_almost_equal, assert_allclose

current_path = os.path.dirname(os.path.abspath(__file__))


class SARIMAXTests(sarimax.SARIMAX):
    def test_loglike(self):
        assert_almost_equal(
            self.result.llf,
            self.true['loglike'], 4
        )

    def test_aic(self):
        assert_almost_equal(
            self.result.aic,
            self.true['aic'], 3
        )

    def test_bic(self):
        assert_almost_equal(
            self.result.bic,
            self.true['bic'], 3
        )


class TestAR3(SARIMAXTests):<commit_msg>TST: Add test for HQIC<commit_after>"""
Tests for SARIMAX models

Author: <NAME>
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function

import numpy as np
import os

from statsmodels.tsa.statespace import sarimax
from .results import results_sarimax
from statsmodels.tools import add_constant
from numpy.testing import assert_almost_equal, assert_allclose

current_path = os.path.dirname(os.path.abspath(__file__))


class SARIMAXTests(sarimax.SARIMAX):
    def test_loglike(self):
        assert_almost_equal(
            self.result.llf,
            self.true['loglike'], 4
        )

    def test_aic(self):
        assert_almost_equal(
            self.result.aic,
            self.true['aic'], 3
        )

    def test_bic(self):
        assert_almost_equal(
            self.result.bic,
            self.true['bic'], 3
        )

    def test_hqic(self):
        hqic = (
            -2*self.result.llf +
            2*np.log(np.log(self.result.nobs)) *
            self.result.params.shape[0]
        )
        assert_almost_equal(
            self.result.hqic,
            hqic, 3
        )


class TestAR3(SARIMAXTests):
{'fraction_non_alphanumeric': 0.09346246973365617, 'fraction_numerical': 0.005811138014527845, 'mean_word_length': 2.525597269624573, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1078774', 'n_tokens_mistral': 699, 'n_tokens_neox': 650, 'n_words': 137}