Skip to content

Add MAMean (MA(q)) model with volatility & forecasting support#778

Open
premdev1234 wants to merge 4 commits into
bashtage:mainfrom
premdev1234:feat/ma-mean-model
Open

Add MAMean (MA(q)) model with volatility & forecasting support#778
premdev1234 wants to merge 4 commits into
bashtage:mainfrom
premdev1234:feat/ma-mean-model

Update mean.py

e6036cb
Select commit
Loading
Failed to load commit list.
Azure Pipelines / bashtage.arch cancelled Jun 24, 2025 in 11m 50s

Build #20250624.2 had test failures

Details

Tests

  • Failed: 231 (0.90%)
  • Passed: 25,292 (98.78%)
  • Other: 82 (0.32%)
  • Total: 25,605

Annotations

Check failure on line 1 in test_notebook[bootstrap_examples]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / bashtage.arch

test_notebook[bootstrap_examples]

nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
------------------
import statsmodels.api as sm

endog = binary[["admit"]]
exog = binary[["gre", "gpa"]]
const = pd.Series(np.ones(exog.shape[0]), index=endog.index)
const.name = "Const"
exog = pd.DataFrame([const, exog.gre, exog.gpa]).T

# Estimate the model
mod = sm.Probit(endog, exog)
fit = mod.fit(disp=0)
params = fit.params
print(params)
------------------


#x1B[31m---------------------------------------------------------------------------#x1B[39m
#x1B[31mImportError#x1B[39m                               Traceback (most recent call last)
#x1B[36mCell#x1B[39m#x1B[36m #x1B[39m#x1B[32mIn[13]#x1B[39m#x1B[32m, line 1#x1B[39m
#x1B[32m----> #x1B[39m#x1B[32m1#x1B[39m #x1B[38;5;28;01mimport#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01mstatsmodels#x1B[39;00m#x1B[34;01m.#x1B[39;00m#x1B[34;01mapi#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mas#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01msm#x1B[39;00m
#x1B[32m      3#x1B[39m endog = binary[[#x1B[33m"#x1B[39m#x1B[33madmit#x1B[39m#x1B[33m"#x1B[39m]]
#x1B[32m      4#x1B[39m exog = binary[[#x1B[33m"#x1B[39m#x1B[33mgre#x1B[39m#x1B[33m"#x1B[39m, #x1B[33m"#x1B[39m#x1B[33mgpa#x1B[39m#x1B[33m"#x1B[39m]]

#x1B[36mFile #x1B[39m#x1B[32mC:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\api.py:76#x1B[39m
#x1B[32m      1#x1B[39m __all__ = [
#x1B[32m      2#x1B[39m     #x1B[33m"#x1B[39m#x1B[33mBayesGaussMI#x1B[39m#x1B[33m"#x1B[39m,
#x1B[32m      3#x1B[39m     #x1B[33m"#x1B[39m#x1B[33mBinomialBayesMixedGLM#x1B[39m#x1B[33m"#x1B[39m,
#x1B[32m   (...)#x1B[39m#x1B[32m     72#x1B[39m     #x1B[33m"#x1B[39m#x1B[33m__version_info__#x1B[39m#x1B[33m"#x1B[39m
#x1B[32m     73#x1B[39m ]
#x1B[32m---> #x1B[39m#x1B[32m76#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m datasets, distributions, iolib, regression, robust, tools
#x1B[32m     77#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01m__init__#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m test
#x1B[32m     78#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01mstatsmodels#x1B[39;00m#x1B[34;01m.#x1B[39;00m#x1B[34;01m_version#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m (
#x1B[32m     79#x1B[39m     version #x1B[38;5;28;01mas#x1B[39;00m __version__, version_tuple #x1B[38;5;28;01mas#x1B[39;00m __version_info__
#x1B[32m     80#x1B[39m )

#x1B[36mFile #x1B[39m#x1B[32mC:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\distributions\__init__.py:7#x1B[39m
#x1B[32m      2#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01mempirical_distribution#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m (
#x1B[32m      3#x1B[39m     ECDF, ECDFDiscrete, monotone_fn_inverter, StepFunction
#x1B[32m      4#x1B[39m     )
#x1B[32m      5#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01medgeworth#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m ExpandedNormal
#x1B[32m----> #x1B[39m#x1B[32m7#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01mdiscrete#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m (
#x1B[32m      8#x1B[39m     genpoisson_p, zipoisson, zigenpoisson, zinegbin,
#x1B[32m      9#x1B[39m     )
#x1B[32m     11#x1B[39m __all__ = [
#x1B[32m     12#x1B[39m     #x1B[33m'#x1B[39m#x1B[33mECDF#x1B[39m#x1B[33m'#x1B[39m,
#x1B[32m     13#x1B[39m     #x1B[33m'#x1B[39m#x1B[33mECDFDiscrete#x1B[39m#x1B[33m'#x1B[39m,
#x1B[32m   (...)#x1B[39m#x1B[32m     21#x1B[39m     #x1B[33m'#x1B[39m#x1B[33mzipoisson#x1B[39m#x1B[33m'#x1B[39m
#x1B[32m     22#x1B[39m     ]
#x1B[32m     24#x1B[39m test = PytestTester()

#x1B[36mFile #x1B[39m#x1B[32mC:\hostedtoolcache\windows\Py
Raw output
args = (<nbconvert.preprocessors.execute.ExecutePreprocessor object at 0x00000288667E7500>, {'cell_type': 'code', 'execution_...n\n# Estimate the model\nmod = sm.Probit(endog, exog)\nfit = mod.fit(disp=0)\nparams = fit.params\nprint(params)'}, 29)
kwargs = {'store_history': True}, name = 'MainThread'
inner = <coroutine object NotebookClient.async_execute_cell at 0x00000288660A1FC0>
loop = <_WindowsSelectorEventLoop running=False closed=False debug=False>

    def wrapped(*args: Any, **kwargs: Any) -> Any:
        name = threading.current_thread().name
        inner = coro(*args, **kwargs)
        try:
>           asyncio.get_running_loop()
E           RuntimeError: no running event loop

C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\jupyter_core\utils\__init__.py:154: RuntimeError

During handling of the above exception, another exception occurred:

notebook = 'D:\\a\\1\\s\\examples\\bootstrap_examples.ipynb'

    @pytest.mark.slow
    @pytest.mark.parametrize("notebook", nbs, ids=ids)
    @pytest.mark.skipif(SKIP, reason=REASON)
    def test_notebook(notebook):
        nb_name = os.path.split(notebook)[-1]
        if nb_name in SLOW_NOTEBOOKS:
            pytest.skip("Notebook is too slow to test")
        nb = nbformat.read(notebook, as_version=4)
        ep = ExecutePreprocessor(allow_errors=False, timeout=240, kernel_name=kernel_name)
>       ep.preprocess(nb, {"metadata": {"path": NOTEBOOK_DIR}})

arch\tests\test_examples.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\nbconvert\preprocessors\execute.py:103: in preprocess
    self.preprocess_cell(cell, resources, index)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\nbconvert\preprocessors\execute.py:124: in preprocess_cell
    cell = self.execute_cell(cell, index, store_history=True)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\jupyter_core\utils\__init__.py:158: in wrapped
    return loop.run_until_complete(inner)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\asyncio\base_events.py:691: in run_until_complete
    return future.result()
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\nbclient\client.py:1062: in async_execute_cell
    await self._check_raise_for_error(cell, cell_index, exec_reply)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <nbconvert.preprocessors.execute.ExecutePreprocessor object at 0x00000288667E7500>
cell = {'cell_type': 'code', 'execution_count': 13, 'metadata': {'execution': {'iopub.status.busy': '2025-06-24T07:29:39.8484...]).T\n\n# Estimate the model\nmod = sm.Probit(endog, exog)\nfit = mod.fit(disp=0)\nparams = fit.params\nprint(params)'}
cell_index = 29
exec_reply = {'buffers': [], 'content': {'ename': 'ImportError', 'engine_info': {'engine_id': -1, 'engine_uuid': 'ff63de8d-2743-4ee...e, 'engine': 'ff63de8d-2743-4ee9-9f7d-ab288d1a6e19', 'started': '2025-06-24T07:29:39.848411Z', 'status': 'error'}, ...}

    async def _check_raise_for_error(
        self, cell: NotebookNode, cell_index: int, exec_reply: dict[str, t.Any] | None
    ) -> None:
        if exec_reply is None:
            return None
    
        exec_reply_content = exec_reply["content"]
        if exec_reply_content["status"] != "error":
            return None
    
        cell_allows_errors = (not self.force_raise_errors) and (
            self.allow_errors
            or exec_reply_content.get("ename") in self.allow_error_names
            or "raises-exception" in cell.metadata.get("tags", [])
        )
        await run_hook(
            self.on_cell_error, cell=cell, cell_index=cell_index, execute_reply=exec_reply
        )
        if not cell_allows_errors:
>           raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content)
E           nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
E           ------

Check failure on line 1 in test_notebook[unitroot_examples]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / bashtage.arch

test_notebook[unitroot_examples]

nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
------------------
import arch.data.default
import pandas as pd
import statsmodels.api as sm

default_data = arch.data.default.load()
default = default_data.BAA.copy()
default.name = "default"
default = default - default_data.AAA.values
fig = default.plot()
------------------


#x1B[31m---------------------------------------------------------------------------#x1B[39m
#x1B[31mImportError#x1B[39m                               Traceback (most recent call last)
#x1B[36mCell#x1B[39m#x1B[36m #x1B[39m#x1B[32mIn[2]#x1B[39m#x1B[32m, line 3#x1B[39m
#x1B[32m      1#x1B[39m #x1B[38;5;28;01mimport#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01march#x1B[39;00m#x1B[34;01m.#x1B[39;00m#x1B[34;01mdata#x1B[39;00m#x1B[34;01m.#x1B[39;00m#x1B[34;01mdefault#x1B[39;00m
#x1B[32m      2#x1B[39m #x1B[38;5;28;01mimport#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01mpandas#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mas#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01mpd#x1B[39;00m
#x1B[32m----> #x1B[39m#x1B[32m3#x1B[39m #x1B[38;5;28;01mimport#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01mstatsmodels#x1B[39;00m#x1B[34;01m.#x1B[39;00m#x1B[34;01mapi#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mas#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01msm#x1B[39;00m
#x1B[32m      5#x1B[39m default_data = arch.data.default.load()
#x1B[32m      6#x1B[39m default = default_data.BAA.copy()

#x1B[36mFile #x1B[39m#x1B[32mC:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\api.py:76#x1B[39m
#x1B[32m      1#x1B[39m __all__ = [
#x1B[32m      2#x1B[39m     #x1B[33m"#x1B[39m#x1B[33mBayesGaussMI#x1B[39m#x1B[33m"#x1B[39m,
#x1B[32m      3#x1B[39m     #x1B[33m"#x1B[39m#x1B[33mBinomialBayesMixedGLM#x1B[39m#x1B[33m"#x1B[39m,
#x1B[32m   (...)#x1B[39m#x1B[32m     72#x1B[39m     #x1B[33m"#x1B[39m#x1B[33m__version_info__#x1B[39m#x1B[33m"#x1B[39m
#x1B[32m     73#x1B[39m ]
#x1B[32m---> #x1B[39m#x1B[32m76#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m datasets, distributions, iolib, regression, robust, tools
#x1B[32m     77#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01m__init__#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m test
#x1B[32m     78#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01mstatsmodels#x1B[39;00m#x1B[34;01m.#x1B[39;00m#x1B[34;01m_version#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m (
#x1B[32m     79#x1B[39m     version #x1B[38;5;28;01mas#x1B[39;00m __version__, version_tuple #x1B[38;5;28;01mas#x1B[39;00m __version_info__
#x1B[32m     80#x1B[39m )

#x1B[36mFile #x1B[39m#x1B[32mC:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\distributions\__init__.py:7#x1B[39m
#x1B[32m      2#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01mempirical_distribution#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m (
#x1B[32m      3#x1B[39m     ECDF, ECDFDiscrete, monotone_fn_inverter, StepFunction
#x1B[32m      4#x1B[39m     )
#x1B[32m      5#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01medgeworth#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m ExpandedNormal
#x1B[32m----> #x1B[39m#x1B[32m7#x1B[39m #x1B[38;5;28;01mfrom#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[34;01m.#x1B[39;00m#x1B[34;01mdiscrete#x1B[39;00m#x1B[38;5;250m #x1B[39m#x1B[38;5;28;01mimport#x1B[39;00m (
#x1B[32m      8#x1B[39m     genpoisson_p, zipoisson, zigenpoisson, zinegbin,
#x1B[32m      9#x1B[39m     )
#x1B[32m     11#x1B[39m __all__ = [
#x1B[32m     12#x1B[39m     #x1B[33m'#x1B[39m#x1B[33mECDF#x1B[39m#x1B[33m'#x1B[39m,
#x1B[32m     13#x1B[39m     #x1B[33m'#x1B[39m#x1B[33mECDFDiscrete#x1B[39m#x1B[33m'#x1B[39m,
#x1B[32m   (...)#x1B[39m#x1B[32m     21#x1B[3
Raw output
args = (<nbconvert.preprocessors.execute.ExecutePreprocessor object at 0x000002886622B3E0>, {'cell_type': 'code', 'execution_...ault_data.BAA.copy()\ndefault.name = "default"\ndefault = default - default_data.AAA.values\nfig = default.plot()'}, 5)
kwargs = {'store_history': True}, name = 'MainThread'
inner = <coroutine object NotebookClient.async_execute_cell at 0x00000288660A22C0>
loop = <_WindowsSelectorEventLoop running=False closed=False debug=False>

    def wrapped(*args: Any, **kwargs: Any) -> Any:
        name = threading.current_thread().name
        inner = coro(*args, **kwargs)
        try:
>           asyncio.get_running_loop()
E           RuntimeError: no running event loop

C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\jupyter_core\utils\__init__.py:154: RuntimeError

During handling of the above exception, another exception occurred:

notebook = 'D:\\a\\1\\s\\examples\\unitroot_examples.ipynb'

    @pytest.mark.slow
    @pytest.mark.parametrize("notebook", nbs, ids=ids)
    @pytest.mark.skipif(SKIP, reason=REASON)
    def test_notebook(notebook):
        nb_name = os.path.split(notebook)[-1]
        if nb_name in SLOW_NOTEBOOKS:
            pytest.skip("Notebook is too slow to test")
        nb = nbformat.read(notebook, as_version=4)
        ep = ExecutePreprocessor(allow_errors=False, timeout=240, kernel_name=kernel_name)
>       ep.preprocess(nb, {"metadata": {"path": NOTEBOOK_DIR}})

arch\tests\test_examples.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\nbconvert\preprocessors\execute.py:103: in preprocess
    self.preprocess_cell(cell, resources, index)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\nbconvert\preprocessors\execute.py:124: in preprocess_cell
    cell = self.execute_cell(cell, index, store_history=True)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\jupyter_core\utils\__init__.py:158: in wrapped
    return loop.run_until_complete(inner)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\asyncio\base_events.py:691: in run_until_complete
    return future.result()
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\nbclient\client.py:1062: in async_execute_cell
    await self._check_raise_for_error(cell, cell_index, exec_reply)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <nbconvert.preprocessors.execute.ExecutePreprocessor object at 0x000002886622B3E0>
cell = {'cell_type': 'code', 'execution_count': 2, 'metadata': {'execution': {'iopub.status.busy': '2025-06-24T07:29:50.80741... default_data.BAA.copy()\ndefault.name = "default"\ndefault = default - default_data.AAA.values\nfig = default.plot()'}
cell_index = 5
exec_reply = {'buffers': [], 'content': {'ename': 'ImportError', 'engine_info': {'engine_id': -1, 'engine_uuid': 'c4398e41-932c-439...e, 'engine': 'c4398e41-932c-4396-b8ea-50439683d448', 'started': '2025-06-24T07:29:50.807419Z', 'status': 'error'}, ...}

    async def _check_raise_for_error(
        self, cell: NotebookNode, cell_index: int, exec_reply: dict[str, t.Any] | None
    ) -> None:
        if exec_reply is None:
            return None
    
        exec_reply_content = exec_reply["content"]
        if exec_reply_content["status"] != "error":
            return None
    
        cell_allows_errors = (not self.force_raise_errors) and (
            self.allow_errors
            or exec_reply_content.get("ename") in self.allow_error_names
            or "raises-exception" in cell.metadata.get("tags", [])
        )
        await run_hook(
            self.on_cell_error, cell=cell, cell_index=cell_index, execute_reply=exec_reply
        )
        if not cell_allows_errors:
>           raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content)
E           nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
E           --------

Check failure on line 1 in test_fixed_equivalence[MAMean-ARCH(p: 3)]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / bashtage.arch

test_fixed_equivalence[MAMean-ARCH(p: 3)]

statsmodels.tools.sm_exceptions.MissingDataError: exog contains inf or nans
Raw output
fit_fixed_models = (                           MA - ARCH Model Results                            
======================================...cified parameters.
Std. errors not available when the model is not estimated, 
ARCHModelFixedResult, id: 0x22d1a09d490)

    @pytest.mark.slow
    def test_fixed_equivalence(fit_fixed_models):
        res, res_fixed = fit_fixed_models
    
        assert_allclose(res.aic, res_fixed.aic)
        assert_allclose(res.bic, res_fixed.bic)
        assert_allclose(res.loglikelihood, res_fixed.loglikelihood)
        assert res.nobs == res_fixed.nobs
        assert res.num_params == res_fixed.num_params
        assert_allclose(res.params, res_fixed.params)
        assert_allclose(res.conditional_volatility, res_fixed.conditional_volatility)
        assert_allclose(res.std_resid, res_fixed.std_resid)
        assert_allclose(res.resid, res_fixed.resid)
>       assert_allclose(res.arch_lm_test(5).stat, res_fixed.arch_lm_test(5).stat)

arch\tests\univariate\test_mean.py:1494: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
arch\univariate\base.py:1736: in arch_lm_test
    res = OLS(lead, lag).fit()
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\regression\linear_model.py:921: in __init__
    super().__init__(endog, exog, missing=missing,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\regression\linear_model.py:746: in __init__
    super().__init__(endog, exog, missing=missing,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\regression\linear_model.py:200: in __init__
    super().__init__(endog, exog, **kwargs)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\model.py:270: in __init__
    super().__init__(endog, exog, **kwargs)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\model.py:95: in __init__
    self.data = self._handle_data(endog, exog, missing, hasconst,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\model.py:135: in _handle_data
    data = handle_data(endog, exog, missing, hasconst, **kwargs)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\data.py:675: in handle_data
    return klass(endog, exog=exog, missing=missing, hasconst=hasconst,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\data.py:88: in __init__
    self._handle_constant(hasconst)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <statsmodels.base.data.ModelData object at 0x0000022D1AF52360>
hasconst = None

    def _handle_constant(self, hasconst):
        if hasconst is False or self.exog is None:
            self.k_constant = 0
            self.const_idx = None
        else:
            # detect where the constant is
            check_implicit = False
            exog_max = np.max(self.exog, axis=0)
            if not np.isfinite(exog_max).all():
>               raise MissingDataError('exog contains inf or nans')
E               statsmodels.tools.sm_exceptions.MissingDataError: exog contains inf or nans

C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\data.py:134: MissingDataError

Check failure on line 1 in test_fixed_equivalence[MAMean-FIGARCH(p: 1, q: 1)]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / bashtage.arch

test_fixed_equivalence[MAMean-FIGARCH(p: 1, q: 1)]

statsmodels.tools.sm_exceptions.MissingDataError: exog contains inf or nans
Raw output
fit_fixed_models = (                          MA - FIGARCH Model Results                          
======================================...cified parameters.
Std. errors not available when the model is not estimated, 
ARCHModelFixedResult, id: 0x22d1f00b800)

    @pytest.mark.slow
    def test_fixed_equivalence(fit_fixed_models):
        res, res_fixed = fit_fixed_models
    
        assert_allclose(res.aic, res_fixed.aic)
        assert_allclose(res.bic, res_fixed.bic)
        assert_allclose(res.loglikelihood, res_fixed.loglikelihood)
        assert res.nobs == res_fixed.nobs
        assert res.num_params == res_fixed.num_params
        assert_allclose(res.params, res_fixed.params)
        assert_allclose(res.conditional_volatility, res_fixed.conditional_volatility)
        assert_allclose(res.std_resid, res_fixed.std_resid)
        assert_allclose(res.resid, res_fixed.resid)
>       assert_allclose(res.arch_lm_test(5).stat, res_fixed.arch_lm_test(5).stat)

arch\tests\univariate\test_mean.py:1494: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
arch\univariate\base.py:1736: in arch_lm_test
    res = OLS(lead, lag).fit()
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\regression\linear_model.py:921: in __init__
    super().__init__(endog, exog, missing=missing,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\regression\linear_model.py:746: in __init__
    super().__init__(endog, exog, missing=missing,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\regression\linear_model.py:200: in __init__
    super().__init__(endog, exog, **kwargs)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\model.py:270: in __init__
    super().__init__(endog, exog, **kwargs)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\model.py:95: in __init__
    self.data = self._handle_data(endog, exog, missing, hasconst,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\model.py:135: in _handle_data
    data = handle_data(endog, exog, missing, hasconst, **kwargs)
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\data.py:675: in handle_data
    return klass(endog, exog=exog, missing=missing, hasconst=hasconst,
C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\data.py:88: in __init__
    self._handle_constant(hasconst)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <statsmodels.base.data.ModelData object at 0x0000022D1AED4770>
hasconst = None

    def _handle_constant(self, hasconst):
        if hasconst is False or self.exog is None:
            self.k_constant = 0
            self.const_idx = None
        else:
            # detect where the constant is
            check_implicit = False
            exog_max = np.max(self.exog, axis=0)
            if not np.isfinite(exog_max).all():
>               raise MissingDataError('exog contains inf or nans')
E               statsmodels.tools.sm_exceptions.MissingDataError: exog contains inf or nans

C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\statsmodels\base\data.py:134: MissingDataError