ó
áp7]c           @   s<   d  Z  d d l Z d d l m Z d e f d „  ƒ  YZ d S(   sv   Descriptive Statistics for Time Series

Created on Sat Oct 30 14:24:08 2010

Author: josef-pktd
License: BSD(3clause)
iÿÿÿÿNi   (   t	   stattoolst   TsaDescriptivec           B   st   e  Z d  Z d d d „ Z d „  Z d d „ Z d d „ Z d d	 „ Z d d
 „ Z	 d „  Z
 d d d d d „ Z RS(   sC   collection of descriptive statistical methods for time series

    t    c         C   s   | |  _  | |  _ | |  _ d  S(   N(   t   datat   labelt   name(   t   selfR   R   R   (    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyt   __init__   s    		c         C   sB   d d l  m } | | | |  j ƒ } |  j | |  j |  j d ƒ S(   Niÿÿÿÿ(   t   lfiltert	   _filtered(   t   scipy.signalR   R   t	   __class__R   R   (   R   t   numt   denR   t	   xfiltered(    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyt   filter   s    i   c         C   sE   d d l  m } | j |  j d | ƒ} |  j | |  j |  j d ƒ S(   Ni   (   t   tsatoolst   ordert
   _detrended(   R   R   t   detrendR   R   R   R   (   R   R   R   t
   xdetrended(    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyR      s    i    c         K   sD   d d l  m } | |  j ƒ |  _ |  j j d | |  |  _ |  j S(   Ni   (   t   ARMAR   (   t   arima_modelR   R   t   modt   fitt   res(   R   R   t   kwdsR   (    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyR   #   s    i(   c         C   s   t  j |  j d | ƒS(   Nt   nlags(   t   sttt   acfR   (   R   R   (    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyR   *   s    c         C   s   t  j |  j d | ƒS(   NR   (   R   t   pacfR   (   R   R   (    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyR   -   s    c         C   s   t  j |  j ƒ S(   N(   R   t   periodogramR   (   R   (    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyR   0   s    id   i   c         C   sk  |  j  } |  j | ƒ } |  j | ƒ } t j d t j | d t ƒ} |  j ƒ  |  }	 | d  k r d d  l	 j
 }
 |
 j ƒ  } n  | j d d d ƒ } |  j rª d |  j n d } | j | ƒ | j d | ƒ | j d d d ƒ } | j | ƒ | j d	 | ƒ | j d d d
 ƒ } | j |	 ƒ | j d | ƒ | j d d d ƒ } | j | ƒ | j d | ƒ | S(   Ni    t   endpointiÿÿÿÿi   i   s    for %sR   s   Time seriest   Autocorrelationi   s   Power Spectrumi   s   Partial Autocorrelation(   R   R   R   t   npt   linspacet   pit   FalseR   t   Nonet   matplotlib.pyplott   pyplott   figuret   add_subplotR   t   plott	   set_title(   R   t   figt   nobst   nacft   nfreqR   R   R   t   wt   spdrt   pltt   axt   namestr(    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyt   plot45   s,    	N(   i   i    i   (   t   __name__t
   __module__t   __doc__R&   R   R   R   R   R   R   R   R6   (    (    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyR      s   		(   R9   t   numpyR"   R   R    R   t   objectR   (    (    (    s?   lib/python2.7/site-packages/statsmodels/tsa/descriptivestats.pyt   <module>   s   