code: def test_diagnostics_nile_eviews():
      # Test the diagnostic tests using the Nile dataset. Results are from
      # "Fitting State Space Models with EViews" (Van den Bossche 2011,
      # Journal of Statistical Software).
      # For parameter values, see Figure 2
      # For Ljung-Box and Jarque-Bera statistics and p-values, see Figure 5
      # The Heteroskedasticity statistic is not provided in this paper.
      niledata = nile.data.load_pandas().data
      niledata.index = pd.date_range(
          "1871-01-01", "1970-01-01", freq="YS"
      )
  
      mod = MLEModel(
          niledata["volume"],
          k_states=1,
          initialization="approximate_diffuse",
          initial_variance=1e15,
          loglikelihood_burn=1,
      )
      mod.ssm["design", 0, 0] = 1
      mod.ssm["obs_cov", 0, 0] = np.exp(9.600350)
      mod.ssm["transition", 0, 0] = 1
      mod.ssm["selection", 0, 0] = 1
      mod.ssm["state_cov", 0, 0] = np.exp(7.348705)
      res = mod.filter([])
  
      # Test Ljung-Box
      # Note: only 3 digits provided in the reference paper
      actual = res.test_serial_correlation(method="ljungbox", lags=10)[
          0, :, -1
      ]
      assert_allclose(actual, [13.117, 0.217], atol=1e-3)
  
      # Test Jarque-Bera
      actual = res.test_normality(method="jarquebera")[0, :2]
      assert_allclose(actual, [0.041686, 0.979373], atol=1e-5)
  
imports: from statsmodels.compat.pandas import MONTH_END
  import os
  import re
  import warnings
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_almost_equal, assert_equal, assert_raises
  import pandas
  import pytest
  from statsmodels.datasets import nile
  from statsmodels.tsa.statespace import kalman_filter, kalman_smoother, sarimax, varmax
  from statsmodels.tsa.statespace.mlemodel import MLEModel, MLEResultsWrapper
  from statsmodels.tsa.statespace.tests.results import results_sarimax, results_var_misc
label_desc: Use image node_id 24 for calling a global function with example usage: test_diagnostics_nile_eviews() without return types