
    M/Ph                         d dl mZ d dlZd dlmZ d dlmZ d dlmZ ddl	m
Z
  G d d	          Zej        j         G d
 de                      Z G d de          ZdS )    )assert_almost_equalN)	stackloss)OLS)add_constant   )RegressionResultsc                   (    e Zd ZdZed             ZdS )GenResz<
    Loads data and creates class instance ot be tested
    c                     t          j                    }t          |j                  |_        t	          |j        |j                                                  | _        t                      | _	        d S )N)
r   loadr   exogr   endogfitres1r   res2)clsdatas     i/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/statsmodels/emplike/tests/test_regression.pysetup_classzGenRes.setup_class   sR    ~ ++	tz49--1133$&&    N)__name__
__module____qualname____doc__classmethodr    r   r   r
   r
      s9          ' ' [' ' 'r   r
   c                      e Zd ZdZej        j        d             Zej        j        d             Zd Z	d Z
ej        j        d             Zej        j        d             Zej        j        d             Zej        j        d	             Zd
S )TestRegressionPowell
    All confidence intervals are tested by conducting a hypothesis
    tests at the confidence interval values.

    See Also
    --------

    test_descriptive.py, test_ci_skew
    c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )Nr   r   powellreturn_weightsmethod      r   el_testr   r   
test_beta0selfbeta0ress     r   test_hypothesis_beta0z*TestRegressionPowell.test_hypothesis_beta0#   sy    9$$cUQC,4 % 6 6HRaRL$)*>rr*BAFFFHQK)=a)@!DDDDDr   c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )N      ?r   r"   r#   r&   r'   r   r)   r   r   
test_beta1r,   beta1ress     r   test_hypothesis_beta1z*TestRegressionPowell.test_hypothesis_beta1*   sy    9$$bTA3q,4 % 6 6HRaRL$)*>rr*BAFFFHQK)=a)@!DDDDDr   c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )Nr   r&   r"   r#   r'   r   r)   r   r   
test_beta2r,   beta2ress     r   test_hypothesis_beta2z*TestRegressionPowell.test_hypothesis_beta21   y    9$$aS1#a,4 % 6 6HRaRL$)*>rr*BAFFFHQK)=a)@!DDDDDr   c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )Nr      r   r"   r#   r&   r'   r   r)   r   r   
test_beta3r,   beta3ress     r   test_hypothesis_beta3z*TestRegressionPowell.test_hypothesis_beta37   r<   r   c                 x    | j                             dddd          }t          || j        j        d           d S )Nr   g33333sJg8r"   lower_boundupper_boundr%   r>   r   conf_int_elr   r   test_ci_beta0r,   beta0cis     r   rJ   z"TestRegressionPowell.test_ci_beta0>   sF    )''u49( ( L LGTY%<a@@@@@r   c                 x    | j                             dddd          }t          || j        j        d           d S )Nr   gn?gZd;O?r"   rE   r'   r   rI   r   r   test_ci_beta1r,   beta1cis     r   rO   z"TestRegressionPowell.test_ci_beta1E   sD    )''t/7 ( 9 9GTY%<a@@@@@r   c                 x    | j                             dddd          }t          || j        j        d           d S )Nr&   zG?皙@r"   rE      r   rI   r   r   test_ci_beta2r,   beta2cis     r   rW   z"TestRegressionPowell.test_ci_beta2K   sF    )''s47 ( J JGTY%<a@@@@@r   c                 x    | j                             dddd          }t          || j        j        d           d S )Nr>   g(\ؿg{Gz?r"   rE      r   rI   r   r   test_ci_beta3r,   beta3cis     r   r]   z"TestRegressionPowell.test_ci_beta3Q   sD    )''t/7 ( 9 9GTY%<a@@@@@r   N)r   r   r   r   pytestmarkslowr.   r5   r;   rC   rJ   rO   rW   r]   r   r   r   r   r      s         [E E E [E E EE E EE E E [A A A [A A A
 [A A A
 [A A A A Ar   r   c                      e Zd ZdZd Zd Zej        j        d             Z	ej        j        d             Z
ej        j        d             Zej        j        d             Zej        j        d             Zej        j        d	             Zd
S )TestRegressionNMr   c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )Nr!   r   r   nmr#   r&   r'   r(   r+   s     r   r.   z&TestRegressionNM.test_hypothesis_beta0c   sy    9$$cUQC,0 % 2 2HRaRL$)*>rr*BAFFFHQK)=a)@!DDDDDr   c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )Nr0   r   rf   r#   r&   r'   r1   r3   s     r   r5   z&TestRegressionNM.test_hypothesis_beta1i   sy    9$$bTA3q,0 % 2 2HRaRL$)*>rr*BAFFFHQK)=a)@!DDDDDr   c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )Nr   r&   rf   r#   r'   r7   r9   s     r   r;   z&TestRegressionNM.test_hypothesis_beta2o   y    9$$aS1#a,0 % 2 2HRaRL$)*>rr*BAFFFHQK)=a)@!DDDDDr   c                     | j                             dgdgdd          }t          |d d         | j        j        d d         d           t          |d         | j        j        d         d           d S )Nr   r>   r   rf   r#   r&   r'   r?   rA   s     r   rC   z&TestRegressionNM.test_hypothesis_beta3v   ri   r   c                 t    | j                             dd          }t          || j        j        d           d S )Nr   rf   r%   r[   rH   rK   s     r   rJ   zTestRegressionNM.test_ci_beta0   s;     )''$'77GTY%<a@@@@@r   c                 t    | j                             dd          }t          || j        j        d           d S )Nr   rf   rl   r[   rN   rP   s     r   rO   zTestRegressionNM.test_ci_beta1   9    )''$'77GTY%<a@@@@@r   c                 x    | j                             dddd          }t          || j        j        d           d S )Nr&   rS   rT   rf   rE   r[   rV   rX   s     r   rW   zTestRegressionNM.test_ci_beta2   sD    )''s/3 ( 5 5GTY%<a@@@@@r   c                 t    | j                             dd          }t          || j        j        d           d S )Nr>   rf   rl   r[   r\   r^   s     r   r]   zTestRegressionNM.test_ci_beta3   rn   r   N)r   r   r   r   r.   r5   r`   ra   rb   r;   rC   rJ   rO   rW   r]   r   r   r   rd   rd   X   s        E E EE E E [E E E [E E E [A A A [A A A [A A A
 [A A A A Ar   rd   )numpy.testingr   r`   statsmodels.datasetsr   #statsmodels.regression.linear_modelr   statsmodels.toolsr   results.el_resultsr   r
   ra   rb   r   rd   r   r   r   <module>rv      s   - - - - - -  * * * * * * 3 3 3 3 3 3 * * * * * * 1 1 1 1 1 1	' 	' 	' 	' 	' 	' 	' 	' =A =A =A =A =A6 =A =A =A@CA CA CA CA CAv CA CA CA CA CAr   