U
    md                     @   s~   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	 d	ZejjG d
d deZG dd deZdS )    )assert_almost_equalN)	stackloss)OLS)add_constant   )RegressionResultsc                   @   s   e Zd ZdZedd ZdS )GenResz<
    Loads data and creates class instance ot be tested
    c                 C   s4   t  }t|j|_t|j|j | _t | _	d S )N)
r   loadr   Zexogr   Zendogfitres1r   res2)clsdata r   b/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/statsmodels/emplike/tests/test_regression.pysetup_class   s    zGenRes.setup_classN)__name__
__module____qualname____doc__classmethodr   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZejjdd Zejjdd Zdd Z	dd	 Z
ejjd
d Zejjdd Zejjdd Zejjd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                 C   sT   | j jdgdgddd}t|d d | jjd d d t|d | jjd d d S )Nr   r   powellZreturn_weightsmethod      r   el_testr   r   Z
test_beta0selfZbeta0resr   r   r   test_hypothesis_beta0#   s
     z*TestRegressionPowell.test_hypothesis_beta0c                 C   sT   | j jdgdgd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   Z
test_beta1r"   Zbeta1resr   r   r   test_hypothesis_beta1*   s
     z*TestRegressionPowell.test_hypothesis_beta1c                 C   sT   | j jdgdgd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   Z
test_beta2r"   Zbeta2resr   r   r   test_hypothesis_beta21   s
     z*TestRegressionPowell.test_hypothesis_beta2c                 C   sT   | j jdgdgd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   Z
test_beta3r"   Zbeta3resr   r   r   test_hypothesis_beta37   s
     z*TestRegressionPowell.test_hypothesis_beta3c                 C   s(   | j jd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"   Zbeta0cir   r   r   r4   >   s
    
 z"TestRegressionPowell.test_ci_beta0c                 C   s(   | j jddddd}t|| jjd d S )Nr   gn?gZd;O?r   r/   r   r   r3   r   r   test_ci_beta1r"   Zbeta1cir   r   r   r7   E   s    z"TestRegressionPowell.test_ci_beta1c                 C   s(   | j jddddd}t|| jjd d S )Nr   zG?皙@r   r/      r   r3   r   r   test_ci_beta2r"   Zbeta2cir   r   r   r=   K   s
    
 z"TestRegressionPowell.test_ci_beta2c                 C   s(   | j jddddd}t|| jjd d S )Nr+   g(\ؿg{Gz?r   r/      r   r3   r   r   test_ci_beta3r"   Zbeta3cir   r   r   rA   Q   s    z"TestRegressionPowell.test_ci_beta3N)r   r   r   r   pytestmarkslowr#   r'   r*   r.   r4   r7   r=   rA   r   r   r   r   r      s   





r   c                   @   s   e Zd ZdZdd Zdd Zejjdd Z	ejjdd	 Z
ejjd
d Zejjdd Zejjdd Zejjdd ZdS )TestRegressionNMr   c                 C   sT   | j jdgdgd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!   r   r   r   r#   c   s
     z&TestRegressionNM.test_hypothesis_beta0c                 C   sT   | j jdgdgddd}t|d d | jjd d d t|d | jjd d d S )Nr$   r   rG   r   r   r   r%   r&   r   r   r   r'   i   s
     z&TestRegressionNM.test_hypothesis_beta1c                 C   sT   | j jdgdgddd}t|d d | jjd d d t|d | jjd d d S )Nr   r   rG   r   r   r(   r)   r   r   r   r*   o   s
     z&TestRegressionNM.test_hypothesis_beta2c                 C   sT   | j jdgdgddd}t|d d | jjd d d t|d | jjd d d S )Nr   r+   r   rG   r   r   r   r,   r-   r   r   r   r.   v   s
     z&TestRegressionNM.test_hypothesis_beta3c                 C   s$   | j jddd}t|| jjd d S )Nr   rG   r   r?   r2   r5   r   r   r   r4      s    zTestRegressionNM.test_ci_beta0c                 C   s$   | j jddd}t|| jjd d S )Nr   rG   rH   r?   r6   r8   r   r   r   r7      s    zTestRegressionNM.test_ci_beta1c                 C   s(   | j jddddd}t|| jjd d S )Nr   r9   r:   rG   r/   r?   r<   r>   r   r   r   r=      s    zTestRegressionNM.test_ci_beta2c                 C   s$   | j jddd}t|| jjd d S )Nr+   rG   rH   r?   r@   rB   r   r   r   rA      s    zTestRegressionNM.test_ci_beta3N)r   r   r   r   r#   r'   rC   rD   rE   r*   r.   r4   r7   r=   rA   r   r   r   r   rF   X   s   





rF   )Znumpy.testingr   rC   Zstatsmodels.datasetsr   Z#statsmodels.regression.linear_modelr   Zstatsmodels.toolsr   Zresults.el_resultsr   r   rD   rE   r   rF   r   r   r   r   <module>   s   @