Ë
    ¢�Djl  ã                   ó2   — d Z ddlZddlmZ  G d„ de«      Zy)a?  
Empirical Likelihood Linear Regression Inference

The script contains the function that is optimized over nuisance parameters to
 conduct inference on linear regression parameters.  It is called by eltest
in OLSResults.


General References
-----------------

Owen, A.B.(2001). Empirical Likelihood. Chapman and Hall

é    N)Ú
_OptFunctsc                   ó&   — e Zd ZdZd„ Z	 	 	 	 dd„Zy)Ú
_ELRegOptszæ

    A class that holds functions to be optimized over when conducting
    hypothesis tests and calculating confidence intervals.

    Parameters
    ----------

    OLSResults : Results instance
        A fitted OLS result.
    c                  ó   — y )N© )Úselfs    úaC:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\statsmodels/emplike/elregress.pyÚ__init__z_ELRegOpts.__init__    s   € Øó    Nc
                 ó~  — |||<   t        j                  t        j                  t        j                  |«      |«      «      }
|||
<   |j	                  |d«      }|| _        ||t        j                  t        j                  ||«      «      z
  j	                  t        |«      d«      z  }|	s‹t        j                  |d¬«      dd }t        j                  ||z  d¬«      dd |z  }|dd…dd…f   |z
  }||z  dd…dd…f   |z
  }t        j                  ||fd¬«      }t        j                  ||fd¬«      }t        j                  t        |«      «      d|z  z  }t        j                  |j                  d   «      j	                  dd«      }	 | j                  |||«      }dt        j                  ||j                   «      z   }d|z  dz  |z  | _        t        j                  t        j$                  || j"                  z  «      «      }d|z  S # t         j&                  j(                  $ r t         j*                  cY S w xY w)a½  
        A function that is optimized over nuisance parameters to conduct a
        hypothesis test for the parameters of interest.

        Parameters
        ----------
        nuisance_params: 1darray
            Parameters to be optimized over.

        Returns
        -------
        llr : float
            -2 x the log-likelihood of the nuisance parameters and the
            hypothesized value of the parameter(s) of interest.
        é   r   )ÚaxisNg      ð?éÿÿÿÿéþÿÿÿ)ÚnpÚint_ÚdeleteÚarangeÚreshapeÚ
new_paramsÚsqueezeÚdotÚintÚmeanÚsumÚconcatenateÚonesÚzerosÚshapeÚ_modif_newtonÚTÚnew_weightsÚlogÚlinalgÚLinAlgErrorÚinf)r   Únuisance_paramsÚ
param_numsÚendogÚexogÚnobsÚnvarÚparamsÚb0_valsÚstochastic_exogÚnuis_param_indexr   Úest_vectÚ
exog_meansÚ	exog_mom2Úmean_est_vectÚmom2_est_vectÚregressor_est_vectÚwtsÚx0Úeta_starÚdenomÚllrs                          r	   Ú_opt_nuis_regressz_ELRegOpts._opt_nuis_regress#   s  € ð& %ˆˆzÑÜŸ7™7¤2§9¡9¬R¯Y©Y°t«_Ø-7ó$9ó :Ðà#2ˆÐÑ Ø—^‘^ D¨!Ó,ˆ
Ø$ˆŒØØ”2—:‘:œbŸf™f T¨:Ó6Ó7Ñ7×
@Ñ
@ÄÀTÃÈAÓ
NñOˆáÜŸ™ ¨AÔ.¨q¨rÐ2ˆJÜŸ™  t¡°!Ô4°a°bÐ9Ø ñ!ˆIà ¢ A¡B ™K¨*Ñ4ˆMØ! D™[ª!¨Q©R¨%Ñ0°9Ñ<ˆMÜ!#§¡°ÀÐ0NØ56ô"8Ðä—~‘~ xÐ1CÐ&DØ01ô3ˆHô �g‰g”c˜$“iÓ  B¨¡IÑ.ˆÜ�X‰X�h—n‘n QÑ'Ó(×0Ñ0°°QÓ7ˆð	Ø×)Ñ)¨"¨h¸Ó<ˆHØœŸ™ ¨(¯*©*Ó5Ñ5ˆEØ! D™y¨2™~°Ñ5ˆDÔô —&‘&œŸ™  t×'7Ñ'7Ñ 7Ó8Ó9ˆCØ˜‘8ˆOøÜ�y‰y×$Ñ$ò 	Ü—6‘6ŠMð	ús   ÆA?H È-H<È;H<)NNNNNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r<   r   r   r	   r   r      s    „ ñ
òð =AØ+/ØEIØ*.ô4r   r   )r@   Únumpyr   Ústatsmodels.emplike.descriptiver   r   r   r   r	   ú<module>rC      s    ðñó Ý 6ôC�õ Cr   