ó
áp7]c           @   s}   d  Z  d d l m Z d d l m Z d Z d e j f d „  ƒ  YZ e e j d ƒ Z	 e	 j
 d d ƒ GHe	 j d	 d
 ƒ GHd S(   sh   

adjusted from Denis on pystatsmodels mailing list

there might still be problems with loc and scale,

iÿÿÿÿ(   t   division(   t   statss   2010-12-29 dect   MaxDistc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   sÔ    max of n of scipy.stats normal expon ...
        Example:
            maxnormal10 = RVmax( scipy.stats.norm, 10 )
            sample = maxnormal10( size=1000 )
            sample.cdf = cdf ^ n,  ppf ^ (1/n)
    c         C   sW   | |  _  | |  _ d d } t t |  ƒ j d d d | j d | j d d d	 | ƒ d  S(
   Ns/   maximumdistribution is the distribution of the s#   maximum of n i.i.d. random variablet   namet   maxdistt   at   bt   longnames   A maximumdistributiont   extradoc(   t   distt   nt   superR   t   __init__R   R   (   t   selfR	   R
   R   (    (    sH   lib/python2.7/site-packages/statsmodels/sandbox/distributions/try_max.pyR      s    		*c         O   s>   |  j  |  j j | | | Ž |  j j | | | Ž |  j  d S(   Ni   (   R
   R	   t   pdft   cdf(   R   t   xt   argst   kw(    (    sH   lib/python2.7/site-packages/statsmodels/sandbox/distributions/try_max.pyt   _pdf   s    c         O   s   |  j  j | | | Ž |  j S(   N(   R	   R   R
   (   R   R   R   R   (    (    sH   lib/python2.7/site-packages/statsmodels/sandbox/distributions/try_max.pyt   _cdf!   s    c         O   s!   |  j  j | d |  j | | Ž S(   Ng      ð?(   R	   t   ppfR
   (   R   t   qR   R   (    (    sH   lib/python2.7/site-packages/statsmodels/sandbox/distributions/try_max.pyt   _ppf$   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   (    (    (    sH   lib/python2.7/site-packages/statsmodels/sandbox/distributions/try_max.pyR      s
   			i
   t   sizet   momentst   mvskN(   R   t
   __future__R    t   scipyR   t   __date__t   rv_continuousR   t   normt   maxdistrt   rvs(    (    (    sH   lib/python2.7/site-packages/statsmodels/sandbox/distributions/try_max.pyt   <module>   s    