class_docstr: Maximum Likelihood Estimation pareto distribution
  
  first version: iid case, with constant parameters
class_docstr_tok: ["Maximum","Likelihood","Estimation","pareto","distribution","first","version",":","iid","case",",","with","constant","parameters"]
docstr: fit Pareto with nested optimization
  
  originally published on stackoverflow
  this does not trim lower values during ks optimization
docstr_tok: ["fit","Pareto","with","nested","optimization","originally","published","on","stackoverflow","this","does","not","trim","lower","values","during","ks","optimization"]
code: def fit_ks(self):
      """fit Pareto with nested optimization
  
      originally published on stackoverflow
      this does not trim lower values during ks optimization
  
      """
      rvs = self.endog
      rvsmin = rvs.min()
      fixdf = np.nan * np.ones(3)
      self.fixed_params = fixdf
      self.fixed_paramsmask = np.isnan(fixdf)
  
      def pareto_ks(loc, rvs):
          # start_scale = rvs.min() - loc # not used yet
          # est = self.fit_fr(rvs, 1., frozen=[np.nan, loc, np.nan])
          self.fixed_params[1] = loc
          est = self.fit(
              start_params=self.start_params[self.fixed_paramsmask]
          ).params
          # est = self.fit(start_params=self.start_params, method='nm').params
          args = (est[0], loc, est[1])
          return stats.kstest(rvs, "pareto", args)[0]
  
      locest = optimize.fmin(pareto_ks, rvsmin - 1.5, (rvs,))
      est = stats.pareto.fit_fr(
          rvs, 0.0, frozen=[np.nan, locest, np.nan]
      )
      args = (est[0], locest[0], est[1])
      return args
  
file_path: statsmodels/statsmodels/examples/ex_generic_mle_tdist.py
imports: import numpy
  from scipy import stats, special, optimize
  import statsmodels.api
  from statsmodels.base.model import GenericLikelihoodModel
  from statsmodels.tools.numdiff import approx_hess
  import statsmodels.sandbox.distributions.sppatch
label_desc: Use image node_id 4 for calling the MyPareto obj's underlying member method code with example usage: obj.fit_ks() and returns: args, stats