docstr: Confirm R-hat statistic returns nan.
code: def test_rhat_nan(self, method):
      """Confirm R-hat statistic returns nan."""
      data = np.random.randn(4, 100)
      data[
          0, 0
      ] = np.nan  #  pylint: disable=unsupported-assignment-operation
      rhat_data = rhat(data, method=method)
      assert np.isnan(rhat_data)
      if method == "rank":
          assert np.isnan(_rhat(rhat_data))
  
imports: import os
  import numpy
  import packaging
  import pandas
  import pytest
  import scipy
  from numpy.testing import assert_almost_equal
  from ...data import from_cmdstan, load_arviz_data
  from ...rcparams import rcParams
  from ...sel_utils import xarray_var_iter
  from ...stats import bfmi, ess, mcse, rhat
  from ...stats.diagnostics import _ess, _ess_quantile, _mc_error, _mcse_quantile, _multichain_statistics, _rhat, _rhat_rank, _split_chains, _z_scale, ks_summary
label_desc: Use image node_id 7 for calling the TestDiagnostics obj's underlying member method code with example usage: obj.test_rhat_nan(method) without return types