U
    Kvf                     @   sZ   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
G d	d
 d
e
ZdS )    N)assert_almost_equal)star98)DescStat   )DescStatResc                   @   s   e Zd ZdZedd ZdS )GenReszC
    Reads in the data and creates class instance to be tested
    c                 C   s^   t  }t|j|_|jd ddf }|jd dddf }t|| _t | _t|| _	d S )N2         )
r   loadnpZasarrayZexogr   res1r   res2mvres1)clsdataZdesc_stat_dataZmv_desc_stat_data r   N/tmp/pip-unpacked-wheel-2v6byqio/statsmodels/emplike/tests/test_descriptive.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e fddZdd Zdd Zdd Zd	d
 Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Z  ZS )%TestDescriptiveStatisticsc                    s   t t|   d S )N)superr   r   )r   	__class__r   r   r      s    z%TestDescriptiveStatistics.setup_classc                 C   s   t | jd| jjd d S )N      )r   r   	test_meanr   Ztest_mean_14selfr   r   r   test_test_mean   s     z(TestDescriptiveStatistics.test_test_meanc                 C   s$   t | jjdddd | jjd d S )Nr   r   Zreturn_weights   r   )r   r   r    r   Ztest_mean_weightsr!   r   r   r   test_test_mean_weights"   s     z0TestDescriptiveStatistics.test_test_mean_weightsc                 C   s   t | j | jjd d S Nr   )r   r   Zci_meanr   r!   r   r   r   test_ci_mean&   s    z&TestDescriptiveStatistics.test_ci_meanc                 C   s   t | jd| jjd d S )N   r   )r   r   test_varr   Z
test_var_3r!   r   r   r   test_test_var)   s     z'TestDescriptiveStatistics.test_test_varc                 C   s$   t | jjdddd | jjd d S )Nr)   r   r$   r%   r   )r   r   r*   r   Ztest_var_weightsr!   r   r   r   test_test_var_weights-   s     z/TestDescriptiveStatistics.test_test_var_weightsc                 C   s   t | j | jjd d S r'   )r   r   Zci_varr   r!   r   r   r   test_ci_var1   s    z%TestDescriptiveStatistics.test_ci_varc                 C   s&   t | jtddg| jjd d S )Nr   8   r   )r   r   mv_test_meanr   arrayr   r!   r   r   r   test_mv_test_mean4   s     z+TestDescriptiveStatistics.test_mv_test_meanc                 C   s.   t | jjtddgddd | jjd d S )Nr   r.   r   r$   r%   r   )r   r   r/   r   r0   r   Zmv_test_mean_wtsr!   r   r   r   test_mv_test_mean_weights8   s     z3TestDescriptiveStatistics.test_mv_test_mean_weightsc                 C   s   t | jd| jjd d S Nr   r   )r   r   	test_skewr   r!   r   r   r   test_test_skew=   s     z(TestDescriptiveStatistics.test_test_skewc                 C   sV   | j  }|d }|d }| j |d }| j |d }t|dd t|dd d S Nr   r   皙?r   )r   Zci_skewr4   r   )r"   Zskew_ci	lower_lim	upper_limul_pvalll_pvalr   r   r   test_ci_skewA   s    
z&TestDescriptiveStatistics.test_ci_skewc                 C   s$   t | jjdddd | jjd d S )Nr   r   r$   r%   r   )r   r   r4   r   Ztest_skew_wtsr!   r   r   r   test_ci_skew_weightsP   s     z.TestDescriptiveStatistics.test_ci_skew_weightsc                 C   s   t | jd| jjd d S r3   )r   r   	test_kurtr   Ztest_kurt_0r!   r   r   r   test_test_kurtT   s     z(TestDescriptiveStatistics.test_test_kurtc                 C   s\   | j jddd}|d }|d }| j |d }| j |d }t|dd t|dd d S )N      ?g      )Zupper_boundZlower_boundr   r   r7   r   )r   Zci_kurtr>   r   )r"   Zkurt_cir8   r9   r:   r;   r   r   r   test_ci_kurtX   s    z&TestDescriptiveStatistics.test_ci_kurtc                 C   s   t | jdd| jjd d S r3   )r   r   test_joint_skew_kurtr   r!   r   r   r   rB   b   s     z.TestDescriptiveStatistics.test_joint_skew_kurtc                 C   s   t | jd| jjd d S )Nr@   r   )r   r   	test_corrr   r!   r   r   r   test_test_corrf   s     z(TestDescriptiveStatistics.test_test_corrc                 C   sV   | j  }|d }|d }| j |d }| j |d }t|dd t|dd d S r6   )r   Zci_corrrC   r   )r"   Zcorr_cir8   r9   r:   r;   r   r   r   test_ci_corrj   s    
z&TestDescriptiveStatistics.test_ci_corrc                 C   s$   t | jjdddd | jjd d S )Nr@   r   r$   r%   r   )r   r   rC   r   Ztest_corr_weightsr!   r   r   r   test_test_corr_weightss   s     z0TestDescriptiveStatistics.test_test_corr_weights)r   r   r   r   r   r#   r&   r(   r+   r,   r-   r1   r2   r5   r<   r=   r?   rA   rB   rD   rE   rF   __classcell__r   r   r   r   r      s&   
	r   )Znumpyr   Znumpy.testingr   Zstatsmodels.datasetsr   Zstatsmodels.emplike.descriptiver   Zresults.el_resultsr   r   r   r   r   r   r   <module>   s   