
    !gg                        d Z ddlZddlmZmZ dZd6dZd6dZd Z	dj                  e	      e	_         d
 Zdj                  e	      e_         d Zdj                  e	      e_         d Zdj                  e	      e_         d Zdj                  e	      e_         d Zdj                  e	      e_         d Zd Zd Zdj                  e	      e_         d Zdj                  e	      e_         d Zdj                  e	      e_         d Zdj                  e	      e_         d Zdj                  e	      e_         d  Zd! Zd"j                  e	      e_         d# Zd$j                  e	      e_         d% Zd& Zd'j                  e	      e_         d( Zd)j                  e	      e_         d* Zd+j                  e	      e_         d, Zd-j                  e	      e_         d. Zd/j                  e	      e_         d0 Z d1 Z!d2j                  e	      e!_         d3 Z"d4j                  e	      e"_         eeeeeeeeee"d5
Z#e	eeeeeeeee!d5
Z$y)7uD  Asymmetric kernels for R+ and unit interval

References
----------

.. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
   Asymmetric Kernel Density Estimators and Smoothed Histograms with
   Application to Income Data.” Econometric Theory 21 (2): 390–412.

.. [2] Chen, Song Xi. 1999. “Beta Kernel Estimators for Density Functions.”
   Computational Statistics & Data Analysis 31 (2): 131–45.
   https://doi.org/10.1016/S0167-9473(99)00010-9.

.. [3] Chen, Song Xi. 2000. “Probability Density Function Estimation Using
   Gamma Kernels.”
   Annals of the Institute of Statistical Mathematics 52 (3): 471–80.
   https://doi.org/10.1023/A:1004165218295.

.. [4] Jin, Xiaodong, and Janusz Kawczak. 2003. “Birnbaum-Saunders and
   Lognormal Kernel Estimators for Modelling Durations in High Frequency
   Financial Data.” Annals of Economics and Finance 4: 103–24.

.. [5] Micheaux, Pierre Lafaye de, and Frédéric Ouimet. 2020. “A Study of Seven
   Asymmetric Kernels for the Estimation of Cumulative Distribution Functions,”
   November. https://arxiv.org/abs/2011.14893v1.

.. [6] Mombeni, Habib Allah, B Masouri, and Mohammad Reza Akhoond. 2019.
   “Asymmetric Kernels for Boundary Modification in Distribution Function
   Estimation.” REVSTAT, 1–27.

.. [7] Scaillet, O. 2004. “Density Estimation Using Inverse and Reciprocal
   Inverse Gaussian Kernels.”
   Journal of Nonparametric Statistics 16 (1–2): 217–26.
   https://doi.org/10.1080/10485250310001624819.


Created on Mon Mar  8 11:12:24 2021

Author: Josef Perktold
License: BSD-3

    N)specialstatsa[  Parameters
    ----------
    x : array_like, float
        Points for which density is evaluated. ``x`` can be scalar or 1-dim.
    sample : ndarray, 1-d
        Sample from which kde is computed.
    bw : float
        Bandwidth parameter, there is currently no default value for it.

    Returns
    -------
    Components for kernel estimationc           
      j   t        |      r|}n	t        |   }|dz  }t        j                  |       t	        |      z  |k  rZt        j                  |       dkD  rt        j
                  |       dddf   }  || ||      }||j                  d      }|S ||z  }|S |*t        j                  t	        |            t	        |      z  }|t	        |      z  }	t	        |       |	z  }
t        j                  | |
      }t        j                  |D cg c]  } ||dddf   ||      |z   c}      }|S c c}w )ac  Density estimate based on asymmetric kernel.

    Parameters
    ----------
    x : array_like, float
        Points for which density is evaluated. ``x`` can be scalar or 1-dim.
    sample : ndarray, 1-d
        Sample from which kernel estimate is computed.
    bw : float
        Bandwidth parameter, there is currently no default value for it.
    kernel_type : str or callable
        Kernel name or kernel function.
        Currently supported kernel names are "beta", "beta2", "gamma",
        "gamma2", "bs", "invgamma", "invgauss", "lognorm", "recipinvgauss" and
        "weibull".
    weights : None or ndarray
        If weights is not None, then kernel for sample points are weighted
        by it. No weights corresponds to uniform weighting of each component
        with 1 / nobs, where nobs is the size of `sample`.
    batch_size : float
        If x is an 1-dim array, then points can be evaluated in vectorized
        form. To limit the amount of memory, a loop can work in batches.
        The number of batches is determined so that the intermediate array
        sizes are limited by

        ``np.size(batch) * len(sample) < batch_size * 1000``.

        Default is to have at most 10000 elements in intermediate arrays.

    Returns
    -------
    pdf : float or ndarray
        Estimate of pdf at points x. ``pdf`` has the same size or shape as x.
         N)
callablekernel_dict_pdfnpsizelenasarraymeanonesarray_splitconcatenate)xsamplebwkernel_typeweights
batch_sizekfuncpdfipdfknx_splitxis                i/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/statsmodels/nonparametric/kernels_asymmetric.pypdf_kernel_asymr!   >   0   H ,d"J	wwqzCK*,771:>

1ag&AQ#?))B-C J .C J ?ggc&k*S[8G#f+%FaK..A&nn(/1"$  %R4[&"=G 1 2 J1   D0c           
      j   t        |      r|}n	t        |   }|dz  }t        j                  |       t	        |      z  |k  rZt        j                  |       dkD  rt        j
                  |       dddf   }  || ||      }||j                  d      }|S ||z  }|S |*t        j                  t	        |            t	        |      z  }|t	        |      z  }	t	        |       |	z  }
t        j                  | |
      }t        j                  |D cg c]  } ||dddf   ||      |z   c}      }|S c c}w )av  Estimate of cumulative distribution based on asymmetric kernel.

    Parameters
    ----------
    x : array_like, float
        Points for which density is evaluated. ``x`` can be scalar or 1-dim.
    sample : ndarray, 1-d
        Sample from which kernel estimate is computed.
    bw : float
        Bandwidth parameter, there is currently no default value for it.
    kernel_type : str or callable
        Kernel name or kernel function.
        Currently supported kernel names are "beta", "beta2", "gamma",
        "gamma2", "bs", "invgamma", "invgauss", "lognorm", "recipinvgauss" and
        "weibull".
    weights : None or ndarray
        If weights is not None, then kernel for sample points are weighted
        by it. No weights corresponds to uniform weighting of each component
        with 1 / nobs, where nobs is the size of `sample`.
    batch_size : float
        If x is an 1-dim array, then points can be evaluated in vectorized
        form. To limit the amount of memory, a loop can work in batches.
        The number of batches is determined so that the intermediate array
        sizes are limited by

        ``np.size(batch) * len(sample) < batch_size * 1000``.

        Default is to have at most 10000 elements in intermediate arrays.

    Returns
    -------
    cdf : float or ndarray
        Estimate of cdf at points x. ``cdf`` has the same size or shape as x.
    r   r   Nr   )
r	   kernel_dict_cdfr   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   cdficdfr   r   r   r   s                r    cdf_kernel_asymr(      r"   r#   c                 b    t         j                  j                  || |z  dz   d| z
  |z  dz         S Nr   )r   betar   r   r   r   s      r    kernel_pdf_betar-      s.    ::>>&!b&1*q1ulQ.>??    u      Beta kernel for density, pdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 1999. “Beta Kernel Estimators for Density Functions.”
       Computational Statistics & Data Analysis 31 (2): 131–45.
       https://doi.org/10.1016/S0167-9473(99)00010-9.
    )
doc_paramsc                 b    t         j                  j                  || |z  dz   d| z
  |z  dz         S r*   )r   r+   sfr,   s      r    kernel_cdf_betar2      s.    ::==R!a!er\A-=>>r.   u#      Beta kernel for cumulative distribution, cdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 1999. “Beta Kernel Estimators for Density Functions.”
       Computational Statistics & Data Analysis 31 (2): 131–45.
       https://doi.org/10.1016/S0167-9473(99)00010-9.
    c                 b   d|dz  z  dz   }d|dz  z  d|dz  z  z   dz   }t        j                  |       dk(  r| d|z  k  rM|t        j                  || dz  z
  | |z  z
        z
  }t        j                  j                  ||d| z
  |z        }|S | dd|z  z
  kD  rOd| z
  }|t        j                  ||dz  z
  ||z  z
        z
  }t        j                  j                  || |z  |      }|S t        j                  j                  || |z  d| z
  |z        }|S | |z  }d| z
  |z  }	| d|z  k  }
| |
   }|t        j                  ||dz  z
  ||z  z
        z
  ||
<   | dd|z  z
  kD  }d| |   z
  }|t        j                  ||dz  z
  ||z  z
        z
  |	|<   t        j                  j                  |||	      }|S N   g      @      g      @r   )r   r   sqrtr   r+   r   r   r   r   a1a2ar   x_alphar+   mask_lowmask_upps               r    kernel_pdf_beta2rA      s    
RUSB	
RUQQY		%B	wwqzQq2v:RWWR!Q$YR/00A**..QUbL9C* J) !a"f*QBRWWR"a%Z"r'122A**..R3C" J **..R!a%2>C J BA|q2v:x[rwwrBEzBG';<<hAF
#8_bggb2q5j27&:;;XjjnnVUD1Jr.   u-      Beta kernel for density, pdf, estimation with boundary corrections.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 1999. “Beta Kernel Estimators for Density Functions.”
       Computational Statistics & Data Analysis 31 (2): 131–45.
       https://doi.org/10.1016/S0167-9473(99)00010-9.
    c                 b   d|dz  z  dz   }d|dz  z  d|dz  z  z   dz   }t        j                  |       dk(  r| d|z  k  rM|t        j                  || dz  z
  | |z  z
        z
  }t        j                  j                  ||d| z
  |z        }|S | dd|z  z
  kD  rOd| z
  }|t        j                  ||dz  z
  ||z  z
        z
  }t        j                  j                  || |z  |      }|S t        j                  j                  || |z  d| z
  |z        }|S | |z  }d| z
  |z  }	| d|z  k  }
| |
   }|t        j                  ||dz  z
  ||z  z
        z
  ||
<   | dd|z  z
  kD  }d| |   z
  }|t        j                  ||dz  z
  ||z  z
        z
  |	|<   t        j                  j                  |||	      }|S r4   )r   r   r8   r   r+   r1   r9   s               r    kernel_cdf_beta2rC   &  s    
RUSB	
RUQQY		%B	wwqzQq2v:RWWR!Q$YR/00A**--AER<8C* J) !a"f*QBRWWR"a%Z"r'122A**--B2C" J **--BQ"=C J BA|q2v:x[rwwrBEzBG';<<hAF
#8_bggb2q5j27&:;;XjjmmFE40Jr.   u"      Beta kernel for cdf estimation with boundary correction.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 1999. “Beta Kernel Estimators for Density Functions.”
       Computational Statistics & Data Analysis 31 (2): 131–45.
       https://doi.org/10.1016/S0167-9473(99)00010-9.
    c                 V    t         j                  j                  || |z  dz   |      }|S Nr   scaler   gammar   )r   r   r   r   s       r    kernel_pdf_gammarJ   \  s'    ;;??61r6A:R?8DKr.   u-      Gamma kernel for density, pdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 2000. “Probability Density Function Estimation Using
       Gamma Krnels.”
       Annals of the Institute of Statistical Mathematics 52 (3): 471–80.
       https://doi.org/10.1023/A:1004165218295.
    c                 V    t         j                  j                  || |z  dz   |      }|S rE   r   rI   r1   )r   r   r   r&   s       r    kernel_cdf_gammarM   t  s)     ;;>>&!b&1*B>7DKr.   u=      Gamma kernel for cumulative distribution, cdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 2000. “Probability Density Function Estimation Using
       Gamma Krnels.”
       Annals of the Institute of Statistical Mathematics 52 (3): 471–80.
       https://doi.org/10.1023/A:1004165218295.
    c                 L    t         j                  j                  || |z  |      S )zGamma kernel for pdf, without boundary corrected part.

    drops `+ 1` in shape parameter

    It should be possible to use this if probability in
    neighborhood of zero boundary is small.

    rF   rH   r,   s      r    _kernel_pdf_gammarO     s!     ;;??61r6?44r.   c                 L    t         j                  j                  || |z  |      S )zGamma kernel for cdf, without boundary corrected part.

    drops `+ 1` in shape parameter

    It should be possible to use this if probability in
    neighborhood of zero boundary is small.

    rF   rL   r,   s      r    _kernel_cdf_gammarQ     s!     ;;>>&!b&>33r.   c                     t        j                  |       dk(  r| d|z  k  r| |z  dz  dz   }n!| |z  }n| |z  }| d|z  k  }||   dz  dz   ||<   t        j                  j	                  |||      }|S Nr   r5   rF   )r   r   r   rI   r   r   r   r   r<   maskr   s         r    kernel_pdf_gamma2rV     s~    	wwqzQq2v:R!aABAF1r6zD'1*q.$
++//&!2/
.CJr.   uF      Gamma kernel for density, pdf, estimation with boundary correction.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 2000. “Probability Density Function Estimation Using
       Gamma Krnels.”
       Annals of the Institute of Statistical Mathematics 52 (3): 471–80.
       https://doi.org/10.1023/A:1004165218295.
    c                     t        j                  |       dk(  r| d|z  k  r| |z  dz  dz   }n!| |z  }n| |z  }| d|z  k  }||   dz  dz   ||<   t        j                  j	                  |||      }|S rS   )r   r   r   rI   r1   rT   s         r    kernel_cdf_gamma2rX     s~    	wwqzQq2v:R!aABAF1r6zD'1*q.$
++..".
-CJr.   u<      Gamma kernel for cdf estimation with boundary correction.

    {doc_params}

    References
    ----------
    .. [1] Bouezmarni, Taoufik, and Olivier Scaillet. 2005. “Consistency of
       Asymmetric Kernel Density Estimators and Smoothed Histograms with
       Application to Income Data.” Econometric Theory 21 (2): 390–412.

    .. [2] Chen, Song Xi. 2000. “Probability Density Function Estimation Using
       Gamma Krnels.”
       Annals of the Institute of Statistical Mathematics 52 (3): 471–80.
       https://doi.org/10.1023/A:1004165218295.
    c                 X    t         j                  j                  |d|z  dz   | |z        S rE   )r   invgammar   r,   s      r    kernel_pdf_invgammar[     s*    >>fa"fqjB??r.   u      Inverse gamma kernel for density, pdf, estimation.

    Based on cdf kernel by Micheaux and Ouimet (2020)

    {doc_params}

    References
    ----------
    .. [1] Micheaux, Pierre Lafaye de, and Frédéric Ouimet. 2020. “A Study of
       Seven Asymmetric Kernels for the Estimation of Cumulative Distribution
       Functions,” November. https://arxiv.org/abs/2011.14893v1.
    c                 X    t         j                  j                  |d|z  dz   | |z        S rE   )r   rZ   r1   r,   s      r    kernel_cdf_invgammar]     s*    >>VQVaZq2v>>r.   u_      Inverse gamma kernel for cumulative distribution, cdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Micheaux, Pierre Lafaye de, and Frédéric Ouimet. 2020. “A Study of
       Seven Asymmetric Kernels for the Estimation of Cumulative Distribution
       Functions,” November. https://arxiv.org/abs/2011.14893v1.
    c                 Z    | }d|z  }t         j                  j                  |||z  |      S rE   )r   invgaussr   r   r   r   mlams        r    kernel_pdf_invgaussrc     s0    	A
b&C>>fa#gS99r.   uZ      Inverse gaussian kernel for density, pdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Scaillet, O. 2004. “Density Estimation Using Inverse and Reciprocal
       Inverse Gaussian Kernels.”
       Journal of Nonparametric Statistics 16 (1–2): 217–26.
       https://doi.org/10.1080/10485250310001624819.
    c                     dt        j                  dt         j                  z  |z  |dz  z        z  t        j                  dd|z  | z  z  || z  dz
  | |z  z   z        z  }|j	                  d      S )zJInverse gaussian kernel density, explicit formula.

    Scaillet 2004
    r   r5      r   )r   r8   piexpr   r   r   r   r   s       r    kernel_pdf_invgauss_ri   &  so    
 rwwq255y2~	12266#R!$
QV(CDEFC88B<r.   c                 Z    | }d|z  }t         j                  j                  |||z  |      S rE   )r   r_   r1   r`   s        r    kernel_cdf_invgaussrk   0  s0    	A
b&C>>VQWC88r.   uj      Inverse gaussian kernel for cumulative distribution, cdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Scaillet, O. 2004. “Density Estimation Using Inverse and Reciprocal
       Inverse Gaussian Kernels.”
       Journal of Nonparametric Statistics 16 (1–2): 217–26.
       https://doi.org/10.1080/10485250310001624819.
    c                 l    d| |z
  z  }d|z  }t         j                  j                  |||z  d|z        S rE   )r   recipinvgaussr   r`   s        r    kernel_pdf_recipinvgaussrn   E  s@    
 	
QVA
b&C""61s7!c'"BBr.   ue      Reciprocal inverse gaussian kernel for density, pdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Scaillet, O. 2004. “Density Estimation Using Inverse and Reciprocal
       Inverse Gaussian Kernels.”
       Journal of Nonparametric Statistics 16 (1–2): 217–26.
       https://doi.org/10.1080/10485250310001624819.
    c                     dt        j                  dt         j                  z  |z  |z        z  t        j                  | |z
   d|z  z  |z  | |z
  z  dz
  | |z
  |z  z         z  }|S )zUReciprocal inverse gaussian kernel density, explicit formula.

    Scaillet 2004
    r   r5   )r   r8   rf   rg   rh   s       r    kernel_pdf_recipinvgauss_rp   ]  su     rwwq255y2~.//66QV*B'&0AF;a?r6V#$ %%C Jr.   c                 l    d| |z
  z  }d|z  }t         j                  j                  |||z  d|z        S rE   )r   rm   r1   r`   s        r    kernel_cdf_recipinvgaussrr   i  s@    
 	
QVA
b&C!!&!c'S!AAr.   u[      Reciprocal inverse gaussian kernel for cdf estimation.

    {doc_params}

    References
    ----------
    .. [1] Scaillet, O. 2004. “Density Estimation Using Inverse and Reciprocal
       Inverse Gaussian Kernels.”
       Journal of Nonparametric Statistics 16 (1–2): 217–26.
       https://doi.org/10.1080/10485250310001624819.
    c                 F    t         j                  j                  |||       S NrF   )r   fatiguelifer   r,   s      r    kernel_pdf_bsrv     s       1 55r.   uZ      Birnbaum Saunders (normal) kernel for density, pdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Jin, Xiaodong, and Janusz Kawczak. 2003. “Birnbaum-Saunders and
       Lognormal Kernel Estimators for Modelling Durations in High Frequency
       Financial Data.” Annals of Economics and Finance 4: 103–24.
    c                 F    t         j                  j                  |||       S rt   )r   ru   r1   r,   s      r    kernel_cdf_bsrx     s     !44r.   u      Birnbaum Saunders (normal) kernel for cdf estimation.

    {doc_params}

    References
    ----------
    .. [1] Jin, Xiaodong, and Janusz Kawczak. 2003. “Birnbaum-Saunders and
       Lognormal Kernel Estimators for Modelling Durations in High Frequency
       Financial Data.” Annals of Economics and Finance 4: 103–24.
    .. [2] Mombeni, Habib Allah, B Masouri, and Mohammad Reza Akhoond. 2019.
       “Asymmetric Kernels for Boundary Modification in Distribution Function
       Estimation.” REVSTAT, 1–27.
    c                     t        j                  dt        j                  d|z         z        }t        j                  j                  |||       S Nr6   r   rF   )r   r8   logr   lognormr   r   r   r   bw_s       r    kernel_pdf_lognormr     s>     ''!BFF1R4L.
!C==VS22r.   u      Log-normal kernel for density, pdf, estimation.

    {doc_params}

    Notes
    -----
    Warning: parameterization of bandwidth will likely be changed

    References
    ----------
    .. [1] Jin, Xiaodong, and Janusz Kawczak. 2003. “Birnbaum-Saunders and
       Lognormal Kernel Estimators for Modelling Durations in High Frequency
       Financial Data.” Annals of Economics and Finance 4: 103–24.
    c                     t        j                  dt        j                  d|z         z        }t        j                  j                  |||       S rz   )r   r8   r{   r   r|   r1   r}   s       r    kernel_cdf_lognormr     s>     ''!BFF1R4L.
!C==FCq11r.   u      Log-normal kernel for cumulative distribution, cdf, estimation.

    {doc_params}

    Notes
    -----
    Warning: parameterization of bandwidth will likely be changed

    References
    ----------
    .. [1] Jin, Xiaodong, and Janusz Kawczak. 2003. “Birnbaum-Saunders and
       Lognormal Kernel Estimators for Modelling Durations in High Frequency
       Financial Data.” Annals of Economics and Finance 4: 103–24.
    c                 >   dt        j                  d|z         z  }dt        j                  |t         j                  z        z  |z  t        j                  t        j                  |       t        j                  |      z
  dz   |z        z  }|j                  d      S )z]Log-normal kernel for density, pdf, estimation, explicit formula.

    Jin, Kawczak 2003
       r   r5   r   )r   r{   r8   rf   rg   r   )r   r   r   termr   s        r    kernel_pdf_lognorm_r     s{    
 rvva"f~Drwwtbee|$$v-66RVVAY/!33d:;<C88B<r.   c           	      ~    t         j                  j                  |d|z  | t        j                  d|z         z        S rE   )r   weibull_minr   r   rI   r,   s      r    kernel_pdf_weibullr     sA    
   R'(7==R+@'@ ! B Br.   u\      Weibull kernel for density, pdf, estimation.

    Based on cdf kernel by Mombeni et al. (2019)

    {doc_params}

    References
    ----------
    .. [1] Mombeni, Habib Allah, B Masouri, and Mohammad Reza Akhoond. 2019.
       “Asymmetric Kernels for Boundary Modification in Distribution Function
       Estimation.” REVSTAT, 1–27.
    c           	      ~    t         j                  j                  |d|z  | t        j                  d|z         z        S rE   )r   r   r1   r   rI   r,   s      r    kernel_cdf_weibullr     sA    
 B&''--B*?&?   A Ar.   u:      Weibull kernel for cumulative distribution, cdf, estimation.

    {doc_params}

    References
    ----------
    .. [1] Mombeni, Habib Allah, B Masouri, and Mohammad Reza Akhoond. 2019.
       “Asymmetric Kernels for Boundary Modification in Distribution Function
       Estimation.” REVSTAT, 1–27.
    )
r+   beta2bsrI   gamma2rZ   r_   r|   rm   weibull)N
   )%__doc__numpyr   scipyr   r   r/   r!   r(   r-   formatr2   rA   rC   rJ   rM   rO   rQ   rV   rX   r[   r]   rc   ri   rk   rn   rp   rr   rv   rx   r   r   r   r   r   r%   r
    r.   r    <module>r      s  )V   (
@F@F@
 	*%  "?
 	*%  ""J 	*%  ""J 	*%  " 	*%  $ 	*%  $	5	4" 	*%  $" 	*%  $@
 	*%  ?

 	*%  : 	*%  9 	*%  C$ 	*%   	B$ 	*%   6

 	*%  5
 	*%   
3 	*%  "
2 	*%  "B 	*%  A
 	*%  " 
##!-! 
##!-!r.   