class_docstr: A Results class for empirical likelihood regression through the origin.
  
  Parameters
  ----------
  model : class
      An OLS model with an intercept.
  
  params : 1darray
      Fitted parameters.
  
  est_llr : float
      The log likelihood ratio of the model with the intercept restricted to
      0 at the maximum likelihood estimates of the parameters.
      llr_restricted/llr_unrestricted
  
  llf_el : float
      The log likelihood of the fitted model with the intercept restricted to 0.
  
  Attributes
  ----------
  model : class
      An OLS model with an intercept.
  
  params : 1darray
      Fitted parameter.
  
  llr : float
      The log likelihood ratio of the maximum empirical likelihood estimate.
  
  llf_el : float
      The log likelihood of the fitted model with the intercept restricted to 0.
  
  Notes
  -----
  IMPORTANT.  Since EL estimation does not drop the intercept parameter but
  instead estimates the slope parameters conditional on the slope parameter
  being 0, the first element for params will be the intercept, which is
  restricted to 0.
  
  IMPORTANT.  This class inherits from RegressionResults but inference is
  conducted via empirical likelihood.  Therefore, any methods that
  require an estimate of the covariance matrix will not function.  Instead
  use el_test and conf_int_el to conduct inference.
  
  Examples
  --------
  >>> import statsmodels.api as sm
  >>> data = sm.datasets.bc.load()
  >>> model = sm.emplike.ELOriginRegress(data.endog, data.exog)
  >>> fitted = model.fit()
  >>> fitted.params #  0 is the intercept term.
  array([ 0.        ,  0.00351813])
  
  >>> fitted.el_test(np.array([.0034]), np.array([1]))
  (3.6696503297979302, 0.055411808127497755)
  >>> fitted.conf_int_el(1)
  (0.0033971871114706867, 0.0036373150174892847)
  
  # No covariance matrix so normal inference is not valid
  >>> fitted.conf_int()
  TypeError: unsupported operand type(s) for *: 'instancemethod' and 'float'
docstr: Returns the llr and p-value for a hypothesized parameter value
  for a regression that goes through the origin.
  
  Parameters
  ----------
  b0_vals : 1darray
      The hypothesized value to be tested.
  
  param_num : 1darray
      Which parameters to test.  Note this uses python
      indexing but the '0' parameter refers to the intercept term,
      which is assumed 0.  Therefore, param_num should be > 0.
  
  return_weights : bool
      If true, returns the weights that optimize the likelihood
      ratio at b0_vals.  Default is False.
  
  method : str
      Can either be 'nm' for Nelder-Mead or 'powell' for Powell.  The
      optimization method that optimizes over nuisance parameters.
      Default is 'nm'.
  
  stochastic_exog : bool
      When TRUE, the exogenous variables are assumed to be stochastic.
      When the regressors are nonstochastic, moment conditions are
      placed on the exogenous variables.  Confidence intervals for
      stochastic regressors are at least as large as non-stochastic
      regressors.  Default is TRUE.
  
  Returns
  -------
  res : tuple
      pvalue and likelihood ratio.
docstr_tok: ["Returns","the","llr","and","p-value","for","a","hypothesized","parameter","value","for","a","regression","that","goes","through","the","origin",".","Parameters","--","--","--","--","--","b0_vals",":","1darray","The","hypothesized","value","to","be","tested",".","param_num",":","1darray","Which","parameters","to","test",".","Note","this","uses","python","indexing","but","the","'","0","'","parameter","refers","to","the","intercept","term",",","which","is","assumed","0",".","Therefore",",","param_num","should","be",">","0.","return_weights",":","bool","If","true",",","returns","the","weights","that","optimize","the","likelihood","ratio","at","b0_vals",".","Default","is","False",".","method",":","str","Can","either","be","'nm","'","for","Nelder-Mead","or","'powell","'","for","Powell",".","The","optimization","method","that","optimizes","over","nuisance","parameters",".","Default","is","'nm","'",".","stochastic_exog",":","bool","When","TRUE",",","the","exogenous","variables","are","assumed","to","be","stochastic",".","When","the","regressors","are","nonstochastic",",","moment","conditions","are","placed","on","the","exogenous","variables",".","Confidence","intervals","for","stochastic","regressors","are","at","least","as","large","as","non-stochastic","regressors",".","Default","is","TRUE",".","Returns","--","--","--","-","res",":","tuple","pvalue","and","likelihood","ratio","."]
code: def el_test(
      self,
      b0_vals,
      param_nums,
      method="nm",
      stochastic_exog=1,
      return_weights=0,
  ):
      """
      Returns the llr and p-value for a hypothesized parameter value
      for a regression that goes through the origin.
  
      Parameters
      ----------
      b0_vals : 1darray
          The hypothesized value to be tested.
  
      param_num : 1darray
          Which parameters to test.  Note this uses python
          indexing but the '0' parameter refers to the intercept term,
          which is assumed 0.  Therefore, param_num should be > 0.
  
      return_weights : bool
          If true, returns the weights that optimize the likelihood
          ratio at b0_vals.  Default is False.
  
      method : str
          Can either be 'nm' for Nelder-Mead or 'powell' for Powell.  The
          optimization method that optimizes over nuisance parameters.
          Default is 'nm'.
  
      stochastic_exog : bool
          When TRUE, the exogenous variables are assumed to be stochastic.
          When the regressors are nonstochastic, moment conditions are
          placed on the exogenous variables.  Confidence intervals for
          stochastic regressors are at least as large as non-stochastic
          regressors.  Default is TRUE.
  
      Returns
      -------
      res : tuple
          pvalue and likelihood ratio.
      """
      b0_vals = np.hstack((0, b0_vals))
      param_nums = np.hstack((0, param_nums))
      test_res = self.model.fit().el_test(
          b0_vals,
          param_nums,
          method=method,
          stochastic_exog=stochastic_exog,
          return_weights=return_weights,
      )
      llr_test = test_res[0]
      llr_res = llr_test - self.llr
      pval = chi2.sf(llr_res, self.model.exog.shape[1] - 1)
      if return_weights:
          return llr_res, pval, test_res[2]
      else:
          return llr_res, pval
  
file_path: statsmodels/statsmodels/emplike/originregress.py
imports: import numpy
  from scipy import optimize
  from scipy.stats import chi2
  from statsmodels.regression.linear_model import OLS, RegressionResults
  from statsmodels.tools.tools import add_constant
label_desc: Use image node_id 2 for calling the OriginResults obj's underlying member method code with example usage: obj.el_test(b0_vals, param_nums, method, stochastic_exog, return_weights) and returns: llr_res,  pval,  test_res, llr_res,  pval