B
    ZL                 @   sB   d Z ddlZddlmZ ddlmZmZm	Z	 dd Z
d	ddZdS )
z[Convenience Wrappers

Created on Sat Oct 30 14:56:35 2010

Author: josef-pktd
License: BSD
    N)GLSWLSOLSc             C   s:   t |  }|t |d 9 }| | } || }| |fS )zremove common rows in [y,x] that contain at least one nan

    TODO: this should be made more flexible,
     arbitrary number of arrays and 1d or 2d arrays

    duplicate: Skipper added sm.tools.drop_missing

    )npZisnanany)yxmask r   9lib/python3.7/site-packages/statsmodels/tools/wrappers.pyremove_nanrows   s
    	r   Tc             K   sr   |rt | |\} }|r$tj|dd}|dk	rBt| |fd|i|S |dk	r`t| |fd|i|S t| |f|S dS )zget linear model with extra options for entry

    dispatches to regular model class and does not wrap the output

    If several options are exclusive, for example sigma and weights, then the
    chosen class depends on the implementation sequence.
    T)ZprependNsigmaweights)r   smZadd_constantr   r   r   )r   r	   r   r   Z	add_constZfilter_missingkwdsr   r   r   linmod   s    
r   )NNTT)__doc__Znumpyr   Zstatsmodels.apiZapir   Zstatsmodelsr   r   r   r   r   r   r   r   r   <module>   s
   