code: def circ_vtest(angles, dir=0.0, w=None, d=None):
      """V test for non-uniformity of circular data with a specified
      mean direction.
  
      Parameters
      ----------
      angles : 1-D array_like
          Samples of angles in radians. The range of ``angles`` must be either
          :math:`[0, 2\\pi]` or :math:`[-\\pi, \\pi]`. If ``angles`` is not
          expressed in radians (e.g. degrees or 24-hours), please use the
          :py:func:`pingouin.convert_angles` function prior to using the present
          function.
      dir : float
          Suspected mean direction (angle in radians).
      w : array_like
          Number of incidences per bins (i.e. "weights"), in case of binned angle
          data.
      d : float
          Spacing (in radians) of bin centers for binned data. If supplied,
          a correction factor is used to correct for bias in the estimation
          of r.
  
      Returns
      -------
      V : float
          V-statistic
      pval : float
          P-value
  
      Notes
      -----
      H0: the population is uniformly distributed around the circle.
      HA: the population is not distributed uniformly around the circle but
      has a mean of dir.
  
      Note: Not rejecting H0 may mean that the population is uniformly
      distributed around the circle OR that it has a mode but that this mode
      is not centered at dir.
  
      The V test has more power than the Rayleigh test and is preferred if
      there is reason to believe in a specific mean direction.
  
      Adapted from the Matlab Circular Statistics Toolbox.
  
      Examples
      --------
      1. V-test for non-uniformity of circular data.
  
      >>> from pingouin import circ_vtest
      >>> x = [0.785, 1.570, 3.141, 0.839, 5.934]
      >>> v, pval = circ_vtest(x, dir=1)
      >>> print(round(v, 3), pval)
      2.486 0.05794648732225438
  
      2. Specifying w and d
  
      >>> v, pval = circ_vtest(x, dir=0.5, w=[.1, .2, .3, .4, .5], d=0.2)
      >>> print(round(v, 3), round(pval, 5))
      0.637 0.23086
      """
      angles = np.asarray(angles)
      if w is None:
          r = circ_r(angles)
          mu = circ_mean(angles)
          n = len(angles)
      else:
          assert len(angles) == len(w), "Input dimensions do not match"
          r = circ_r(angles, w, d)
          mu = circ_mean(angles, w)
          n = np.sum(w)
  
      # Compute Rayleigh and V statistics
      R = n * r
      v = R * np.cos(mu - dir)
  
      # Compute p value
      u = v * np.sqrt(2 / n)
      pval = 1 - norm.cdf(u)
      return v, pval
  
file_path: pingouin/pingouin/circular.py
imports: import numpy
  from scipy.stats import norm
  from .utils import remove_na
label_desc: Use image node_id 9 for calling a global function with example usage: circ_vtest(angles, dir, w, d) and returns: v,  pval