title: RVS Argument of Scipy Kstest for non-standard (Landau) distribution
body: <p>I am working with Landau distributions (<a href="https://en.wikipedia.org/wiki/Landau_distribution" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Landau_distribution</a>) and am trying to use scipy.stats.kstest to get a goodness of fit statistic. </p>
  
  <p>Since the Landau distribution is a non-standard distribution for scipy, I am using an import from ROOT (the CERN C++ package) as a custom, callable CDF as per the stats.kstest documentation. I also have a 1-D array of my measured/empirical data. </p>
  
  <p>As it stands, I have the following definition of my kstest function:</p>
  
  <pre><code>def get_ks_test(fit_info):
  
      coeffs, erfc_bool = fit_info[0], fit_info[4]
      (mu,sigma,A_l,A_e) = coeffs
  
      def Lcdf(x):
          return [A_l*Math.landau_cdf(i,sigma,mu) for i in x]
  
      def integrand(x):
          return A_e*erfc((x-mu)/sigma)
  
      def total_cdf(x):
          return Lcdf(x) + quad(integrand,0,x)
  
      scatter_data = pdf_fit_return[3]
  
      return kstest(scatter_data,total_cdf)
  </code></pre>
  
  <p>Here <code>Lcdf</code> and <code>integrand</code> are combined to form my callable CDF function. The problem arises with the first argument of kstest, the "rvs" array <code>scatter_data</code>. As I understand it, the "rvs" argument is supposed to be an array of observations to match with the distribution in question. But in the source code, "rvs" is sent as an argument to "cdf". This makes no sense to me; shouldn't the CDF be a function of x, not of the data it's supposed to match?</p>
  
  <p>When I pass my <code>scatter_data</code> as the first argument of kstest, it tries to plug those values into <code>total_cdf</code> when that function is supposed to take an argument in x. I don't know if I am failing to understand the usage of rvs/cdf here or what, but the way the kstest function is designed seems backwards to me. </p>
  
  <p>I would like to be able to give kstest my data, my intended distribution (a callable CDF) but all the examples I've seen online involve included or standard distributions (normal, beta, etc.).</p>