U
    ÃmœdÄ
  ã                   @   s.   d Z ddlZddlmZ d	dd„Zdd„ ZdS )
zK
Created on Mar 30, 2022 1:21:54 PM

Author: Josef Perktold
License: BSD-3
é    N)Úassert_allcloseÚdiffc                 C   s.  |dkrp| | }t  | |d  d ||d  d  ¡}t  | |d  d ||d  d  ¡}|| || f}�nº|dkrà| | }t  | |d  d ||d  d  ¡}t  | |d  d ||d  d  ¡}|| || f}�nJ|dk�r*| | }	|d |d | d  }
|d |d | d  }|	t  |	d |
| d |d |  d    ¡ |
 }|	t  |	d || d |d |  d    ¡ | }|\}}|\}}|d| |  }
|d| |  }|	t  |	d |
| d|  |   ¡ |
 }|	t  |	d || d|  |   ¡ | }t||f||fddd	� ||f}|S )
uh  

    References
    ----------

    .. [#] Krishnamoorthy, K., Jie Peng, and Dan Zhang. 2016. â€œModified Large
       Sample Confidence Intervals for Poisson Distributions: Ratio, Weighted
       Average, and Product of Means.â€� Communications in Statistics - Theory
       and Methods 45 (1): 83â€“97. https://doi.org/10.1080/03610926.2013.821486.


    .. [#] Li, Yanhong, John J. Koval, Allan Donner, and G. Y. Zou. 2010.
       â€œInterval Estimation for the Area under the Receiver Operating
       Characteristic Curve When Data Are Subject to Error.â€� Statistics in
       Medicine 29 (24): 2521â€“31. https://doi.org/10.1002/sim.4015.

    .. [#] Zou, G. Y., and A. Donner. 2008. â€œConstruction of Confidence Limits
       about Effect Measures: A General Approach.â€� Statistics in Medicine 27
       (10): 1693â€“1702. https://doi.org/10.1002/sim.3095.
    r   r   é   é   ÚsumÚratiogVçž¯Ò<g»½×Ùß|Û=)ZatolZrtol)ÚnpÚsqrtr   )Zstat1Zstat2Zci1Zci2ZcontrastÚstatÚlow_halfÚupp_halfÚciÚprodZterm1Zterm2Zlow_Zupp_Zlow1Zupp1Zlow2Zupp2ÚlowZupp© r   ú[/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/statsmodels/stats/_inference_tools.pyÚ_mover_confint   sR    &&&&
(ÿþ(ÿþ ÿþ ÿþr   c                 C   sV   |   d¡}t t  ||d  d ¡¡}t t  ||d  d ¡¡}| | | | f}|S )Nr   r   r   )r   r   r	   )r
   r   Zstat_r   r   r   r   r   Ú_mover_confint_sumM   s
    
r   )r   )Ú__doc__Únumpyr   Znumpy.testingr   r   r   r   r   r   r   Ú<module>   s   
A