docstr: Confirm R-hat statistic returns nan.
code: def test_rhat_shape(self, method, chain, draw):
      """Confirm R-hat statistic returns nan."""
      data = (
          np.random.randn(draw)
          if chain is None
          else np.random.randn(chain, draw)
      )
      if (chain in (None, 1)) or (draw < 4):
          rhat_data = rhat(data, method=method)
          assert np.isnan(rhat_data)
      else:
          rhat_data = rhat(data, method=method)
          assert not np.isnan(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 8 for calling the TestDiagnostics obj's underlying member method code with example usage: obj.test_rhat_shape(method, chain, draw) without return types