+
    Z°³jêf  ã                   óº   € ^ RI Ht ^ RIHtHt ^ RIHt ^ RIHtH	t	H
t
HtHtHtHtHtHtHtHtHtHtHtHtHt ^ RIt^RIHtHt ^RIHt R.t ! R	 R4      tR
 t R# )é    )ÚGenericAlias)ÚlinalgÚspecial)Úcheck_random_state)ÚasarrayÚ
atleast_2dÚreshapeÚzerosÚnewaxisÚexpÚpiÚsqrtÚravelÚpowerÚ
atleast_1dÚsqueezeÚsumÚ	transposeÚonesÚcovN)Úgaussian_kernel_estimateÚgaussian_kernel_estimate_log)Úmultivariate_normalÚgaussian_kdec                   óò   a € ] tR t^&t o Rt]! ]4      tRR ltR t	]	t
R tR tRRR/R lltR	 tRR
 ltR tR t]tR]n        RR ltR t]R 4       tR tR tR t]R 4       t]R 4       tV 3R ltRtV tR# )r   ay  Representation of a kernel-density estimate using Gaussian kernels.

Kernel density estimation is a way to estimate the probability density
function (PDF) of a random variable in a non-parametric way.
`gaussian_kde` works for both uni-variate and multi-variate data.   It
includes automatic bandwidth determination.  The estimation works best for
a unimodal distribution; bimodal or multi-modal distributions tend to be
oversmoothed.

Parameters
----------
dataset : array_like
    Datapoints to estimate from. In case of univariate data this is a 1-D
    array, otherwise a 2-D array with shape (# of dims, # of data).
bw_method : str, scalar or callable, optional
    The method used to calculate the bandwidth factor.  This can be
    'scott', 'silverman', a scalar constant or a callable.  If a scalar,
    this will be used directly as `factor`.  If a callable, it should
    take a `gaussian_kde` instance as only parameter and return a scalar.
    If None (default), 'scott' is used.  See Notes for more details.
weights : array_like, optional
    weights of datapoints. This must be the same shape as dataset.
    If None (default), the samples are assumed to be equally weighted

Attributes
----------
dataset : ndarray
    The dataset with which `gaussian_kde` was initialized.
d : int
    Number of dimensions.
n : int
    Number of datapoints.
neff : int
    Effective number of datapoints.

    .. versionadded:: 1.2.0
factor : float
    The bandwidth factor obtained from `covariance_factor`.
covariance : ndarray
    The kernel covariance matrix; this is the data covariance matrix
    multiplied by the square of the bandwidth factor, e.g.
    ``np.cov(dataset) * factor**2``.
inv_cov : ndarray
    The inverse of `covariance`.

Methods
-------
evaluate
__call__
integrate_gaussian
integrate_box_1d
integrate_box
integrate_kde
pdf
logpdf
resample
set_bandwidth
covariance_factor
marginal

Notes
-----
Bandwidth selection strongly influences the estimate obtained from the KDE
(much more so than the actual shape of the kernel).  Bandwidth selection
can be done by a "rule of thumb", by cross-validation, by "plug-in
methods" or by other means; see [3]_, [4]_ for reviews.  `gaussian_kde`
uses a rule of thumb, the default is Scott's Rule.

Scott's Rule [1]_, implemented as `scotts_factor`, is::

    n**(-1./(d+4)),

with ``n`` the number of data points and ``d`` the number of dimensions.
In the case of unequally weighted points, `scotts_factor` becomes::

    neff**(-1./(d+4)),

with ``neff`` the effective number of datapoints.
Silverman's suggestion for *multivariate* data [2]_, implemented as
`silverman_factor`, is::

    (n * (d + 2) / 4.)**(-1. / (d + 4)).

or in the case of unequally weighted points::

    (neff * (d + 2) / 4.)**(-1. / (d + 4)).

Note that this is not the same as "Silverman's rule of thumb" [6]_, which
may be more robust in the univariate case; see documentation of the
``set_bandwidth`` method for implementing a custom bandwidth rule.

Good general descriptions of kernel density estimation can be found in [1]_
and [2]_, the mathematics for this multi-dimensional implementation can be
found in [1]_.

With a set of weighted samples, the effective number of datapoints ``neff``
is defined by::

    neff = sum(weights)^2 / sum(weights^2)

as detailed in [5]_.

`gaussian_kde` does not currently support data that lies in a
lower-dimensional subspace of the space in which it is expressed. For such
data, consider performing principal component analysis / dimensionality
reduction and using `gaussian_kde` with the transformed data.

References
----------
.. [1] D.W. Scott, "Multivariate Density Estimation: Theory, Practice, and
       Visualization", John Wiley & Sons, New York, Chicester, 1992.
.. [2] B.W. Silverman, "Density Estimation for Statistics and Data
       Analysis", Vol. 26, Monographs on Statistics and Applied Probability,
       Chapman and Hall, London, 1986.
.. [3] B.A. Turlach, "Bandwidth Selection in Kernel Density Estimation: A
       Review", CORE and Institut de Statistique, Vol. 19, pp. 1-33, 1993.
.. [4] D.M. Bashtannyk and R.J. Hyndman, "Bandwidth selection for kernel
       conditional density estimation", Computational Statistics & Data
       Analysis, Vol. 36, pp. 279-298, 2001.
.. [5] Gray P. G., 1969, Journal of the Royal Statistical Society.
       Series A (General), 132, 272
.. [6] Kernel density estimation. *Wikipedia.*
       https://en.wikipedia.org/wiki/Kernel_density_estimation

Examples
--------
Generate some random two-dimensional data:

>>> import numpy as np
>>> from scipy import stats
>>> def measure(n):
...     "Measurement model, return two coupled measurements."
...     m1 = np.random.normal(size=n)
...     m2 = np.random.normal(scale=0.5, size=n)
...     return m1+m2, m1-m2

>>> m1, m2 = measure(2000)
>>> xmin = m1.min()
>>> xmax = m1.max()
>>> ymin = m2.min()
>>> ymax = m2.max()

Perform a kernel density estimate on the data:

>>> X, Y = np.mgrid[xmin:xmax:100j, ymin:ymax:100j]
>>> positions = np.vstack([X.ravel(), Y.ravel()])
>>> values = np.vstack([m1, m2])
>>> kernel = stats.gaussian_kde(values)
>>> Z = np.reshape(kernel(positions).T, X.shape)

Plot the results:

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> ax.imshow(np.rot90(Z), cmap=plt.cm.gist_earth_r,
...           extent=[xmin, xmax, ymin, ymax])
>>> ax.plot(m1, m2, 'k.', markersize=2)
>>> ax.set_xlim([xmin, xmax])
>>> ax.set_ylim([ymin, ymax])
>>> plt.show()

Compare against manual KDE at a point:

>>> point = [1, 2]
>>> mean = values.T
>>> cov = kernel.factor**2 * np.cov(values)
>>> X = stats.multivariate_normal(cov=cov)
>>> res = kernel.pdf(point)
>>> ref = X.pdf(point - mean).sum() / len(mean)
>>> np.allclose(res, ref)
True
Nc                ój  € \        \        V4      4      V n        V P                  P                  ^8”  g   \	        R4      hV P                  P
                  w  V n        V n        VeÜ   \        V4      P                  \        4      V n        V ;P                  \        V P                  4      ,          un        V P                  P                  ^8w  d   \	        R4      h\        V P                  4      V P                  8w  d   \	        R4      h^\         P"                  ! V P                  V P                  4      ,          V n        V P                  V P                  8”  d   Rp\	        V4      h V P'                  VR7       R#   \(        P*                   d   pRp\(        P*                  ! T4      ThRp?ii ; i)é   z.`dataset` input should have multiple elements.Nz*`weights` input should be one-dimensional.z%`weights` input should be of length na1  Number of dimensions is greater than number of samples. This results in a singular data covariance matrix, which cannot be treated using the algorithms implemented in `gaussian_kde`. Note that `gaussian_kde` interprets each *column* of `dataset` to be a point; consider transposing the input to `dataset`.©Ú	bw_methodab  The data appears to lie in a lower-dimensional subspace of the space in which it is expressed. This has resulted in a singular data covariance matrix, which cannot be treated using the algorithms implemented in `gaussian_kde`. Consider performing principal component analysis / dimensionality reduction and using `gaussian_kde` with the transformed data.)r   r   ÚdatasetÚsizeÚ
ValueErrorÚshapeÚdÚnr   ÚastypeÚfloatÚ_weightsr   ÚweightsÚndimÚlenÚnpÚvecdotÚ_neffÚset_bandwidthr   ÚLinAlgError)Úselfr    r   r)   ÚmsgÚes   &&&&  ÚQ/home/luca/screen-checking/.venv/lib/python3.14/site-packages/scipy/stats/_kde.pyÚ__init__Úgaussian_kde.__init__×   sF  € Ü!¤'¨'Ó"2Ó3ˆŒØ�|‰|× Ñ  1Ô$ÜÐMÓNÐNàŸ™×+Ñ+‰ˆŒ�”àÒÜ& wÓ/×6Ñ6´uÓ=ˆDŒMØ�MŠMœS §¡Ó/Õ/�MØ�|‰|× Ñ  AÔ%Ü Ð!MÓNÐNÜ�4—=‘=Ó! T§V¡VÔ+Ü Ð!HÓIÐIØœ2Ÿ9š9 T§]¡]°D·M±MÓBÕBˆDŒJð �6‰6�D—F‘FŒ?ð-ˆCô ˜S“/Ð!ð
	1Ø×Ñ¨ÐÖ3øÜ×!Ñ!ô 	1ð?ˆCô ×$Ò$ SÓ)¨qÐ0ûð	1ús   Å+E? Å?F2ÆF-Æ-F2c                óä  € \        \        V4      4      pVP                  w  r#W P                  8w  dO   V^8X  d+   W0P                  8X  d   \	        WP                  ^34      p^pMRV RV P                   2p\        V4      h\        V P                  V4      w  rV\        V,          ! V P                  P                  V P                  R,          VP                  V P                  V4      pVR,          # )a©  Evaluate the estimated pdf on a set of points.

Parameters
----------
points : (# of dimensions, # of points)-array
    Alternatively, a (# of dimensions,) vector can be passed in and
    treated as a single point.

Returns
-------
values : (# of points,)-array
    The values at each point.

Raises
------
ValueError : if the dimensionality of the input points is different than
             the dimensionality of the KDE.

úpoints have dimension ú, dataset has dimension ©ºNNNN©r;   r   )r   r   r#   r$   r	   r"   Ú_get_output_dtypeÚ
covariancer   r    ÚTr)   Úcho_cov)r1   Úpointsr$   Úmr2   Úoutput_dtypeÚspecÚresults   &&      r4   ÚevaluateÚgaussian_kde.evaluateý   sÅ   € ô( œG F›OÓ,ˆà�|‰|‰ˆØ—‘Œ;Ø�AŒv˜!Ÿv™vœ+ä  ¯&©&°!¨Ó5�Ø‘à/°¨sð 30Ø04·±¨xð9�ä  “oÐ%ä.¨t¯©ÀÓGÑˆÜ)¨$Ö/Ø�L‰L�N‰N˜DŸL™L¨Õ1Ø�H‰H�d—l‘l Ló2ˆð �d�|Ðó    c                ó`  € \        \        V4      4      p\        V4      pVP                  V P                  38w  d   \        RV P                   24      hVP                  V P                  V P                  38w  d   \        RV P                   24      hVR\        3,          pV P                  V,           p\        P                  ! V4      pV P                  V,
          p\        P                  ! WE4      p\        P                  ! \        P                  ! V^ ,          4      4      p\        ^\         ,          VP                  ^ ,          R,          4      V,          p\        P"                  ! WV^ R7      R,          p	\        P"                  ! \%        V	) 4      V P&                  ^ R7      V,          p
V
# )aÇ  
Multiply estimated density by a multivariate Gaussian and integrate
over the whole space.

Parameters
----------
mean : aray_like
    A 1-D array, specifying the mean of the Gaussian.
cov : array_like
    A 2-D array, specifying the covariance matrix of the Gaussian.

Returns
-------
result : scalar
    The value of the integral.

Raises
------
ValueError
    If the mean or covariance of the input Gaussian differs from
    the KDE's dimensionality.

zmean does not have dimension z#covariance does not have dimension r;   ç       @©Úaxis)r   r   r   r#   r$   r"   r   r>   r   Ú
cho_factorr    Ú	cho_solver,   ÚprodÚdiagonalr   r   r-   r   r)   )r1   Úmeanr   Úsum_covÚsum_cov_cholÚdiffÚtdiffÚsqrt_detÚ
norm_constÚenergiesrE   s   &&&        r4   Úintegrate_gaussianÚgaussian_kde.integrate_gaussian'  s;  € ô0 œ' $›-Ó(ˆÜ˜‹oˆà�:‰:˜$Ÿ&™&˜Ô"ÜÐ<¸T¿V¹V¸HÐEÓFÐFØ�9‰9˜Ÿ™ §¡Ð(Ô(ÜÐBÀ4Ç6Á6À(ÐKÓLÐLð �A”w�JÕˆà—/‘/ CÕ'ˆô
 ×(Ò(¨Ó1ˆà�|‰|˜dÕ"ˆÜ× Ò  Ó4ˆä—7’7œ2Ÿ;š; |°A¥Ó7Ó8ˆÜ˜1œr�6 7§=¡=°Õ#3°cÕ#9Ó:¸XÕEˆ
ä—9’9˜T¨qÔ1°CÕ7ˆÜ—’œ3 ˜y›>¨4¯<©<¸aÔ@À:ÕMˆàˆrH   c                ó´  € V P                   ^8w  d   \        R4      h\        \        V P                  4      4      ^ ,          p\        WP
                  ,
          V,          4      p\        W P
                  ,
          V,          4      p\        P                  ! V4      \        P                  ! V4      ,
          p\        P                  ! V P                  V4      pV# )a4  
Computes the integral of a 1D pdf between two bounds.

Parameters
----------
low : scalar
    Lower bound of integration.
high : scalar
    Upper bound of integration.

Returns
-------
value : scalar
    The result of the integral.

Raises
------
ValueError
    If the KDE is over more than one dimension.

z'integrate_box_1d() only handles 1D pdfs)r$   r"   r   r   r>   r    r   Úndtrr,   r-   r)   )r1   ÚlowÚhighÚstdevÚnormalized_lowÚnormalized_highÚdeltaÚvalues   &&&     r4   Úintegrate_box_1dÚgaussian_kde.integrate_box_1d\  s”   € ð, �6‰6�QŒ;ÜÐFÓGÐGä”d˜4Ÿ?™?Ó+Ó,¨QÕ/ˆä §l¡lÕ 2°eÕ;Ó<ˆÜ ¯©Õ!4¸Õ =Ó>ˆä—’˜_Ó-´·²¸^Ó0LÕLˆÜ—	’	˜$Ÿ,™,¨Ó.ˆØˆrH   Úrngc               óü   € WP                   P                  ,
          W P                   P                  ,
          re\        P                  ! WeV P                  VVR7      p\
        P                  ! WpP                  RR7      # )a¶  Computes the integral of a pdf over a rectangular interval.

Parameters
----------
low_bounds : array_like
    A 1-D array containing the lower bounds of integration.
high_bounds : array_like
    A 1-D array containing the upper bounds of integration.
maxpts : int, optional
    The maximum number of points to use for integration.
rng : `numpy.random.Generator`, optional
    Pseudorandom number generator state. When `rng` is None, a new
    generator is created using entropy from the operating system. Types
    other than `numpy.random.Generator` are passed to
    `numpy.random.default_rng` to instantiate a ``Generator``.

Returns
-------
value : scalar
    The result of the integral.

)Úlower_limitr   Úmaxptsrf   rK   éÿÿÿÿ)r    r?   r   Úcdfr>   r,   r-   r)   )r1   Ú
low_boundsÚhigh_boundsri   rf   r]   r^   Úvaluess   &&&&$   r4   Úintegrate_boxÚgaussian_kde.integrate_box~  sV   € ð. §¡§¡Õ/°¿|¹|¿~¹~Õ1MˆTÜ$×(Ò(Ø t§¡¸vØô
ˆô �yŠy˜§¡°BÔ7Ð7rH   c                óv  € VP                   V P                   8w  d   \        R4      hVP                  V P                  8  d   TpT pMT pTpVP                  VP                  ,           p\        P
                  ! V4      pRp\        VP                  4       F±  pVP                  RV\        3,          pVP                  V,
          p	\        P                  ! WY4      p
\        P                  ! Wš^ R7      R,          pV\        P                  ! \        V) 4      VP                  ^ R7      VP                  V,          ,          ,          pK³  	  \        P                  ! \        P                  ! V^ ,          4      4      p\!        ^\"        ,          VP$                  ^ ,          R,          4      V,          pWm,          pV# )a'  
Computes the integral of the product of this  kernel density estimate
with another.

Parameters
----------
other : gaussian_kde instance
    The other kde.

Returns
-------
value : scalar
    The result of the integral.

Raises
------
ValueError
    If the KDEs have different dimensionality.

z$KDEs are not the same dimensionalityg        r;   rK   rJ   )r$   r"   r%   r>   r   rM   Úranger    r   rN   r,   r-   r   r)   rO   rP   r   r   r#   )r1   ÚotherÚsmallÚlargerR   rS   rE   ÚirQ   rT   rU   rX   rV   rW   s   &&            r4   Úintegrate_kdeÚgaussian_kde.integrate_kdeœ  sG  € ð* �7‰7�d—f‘fÔÜÐCÓDÐDð �7‰7�T—V‘VÔØˆEØ‰EàˆEØˆEà×"Ñ" U×%5Ñ%5Õ5ˆÜ×(Ò(¨Ó1ˆØˆÜ�u—w‘w–ˆAØ—=‘=  A¤w Õ/ˆDØ—=‘= 4Õ'ˆDÜ×$Ò$ \Ó8ˆEä—y’y °1Ô5¸Õ;ˆHØ”b—i’i¤ X I£°·±ÀAÔFÀuÇ}Á}ÐUVÕGWÕWÕWŠFñ  ô —7’7œ2Ÿ;š; |°A¥Ó7Ó8ˆÜ˜1œr�6 7§=¡=°Õ#3°cÕ#9Ó:¸XÕEˆ
àÕˆàˆrH   c                óR  € Vf   \        V P                  4      p\        V4      p\        VP	                  \        V P                  3\        4      V P                  VR7      4      pVP                  V P                  WP                  R7      pV P                  RV3,          pWd,           # )a±  Randomly sample a dataset from the estimated pdf.

Parameters
----------
size : int, optional
    The number of samples to draw.  If not provided, then the size is
    the same as the effective number of samples in the underlying
    dataset.
seed : {None, int, `numpy.random.Generator`, `numpy.random.RandomState`}, optional
    If `seed` is None (or `np.random`), the `numpy.random.RandomState`
    singleton is used.
    If `seed` is an int, a new ``RandomState`` instance is used,
    seeded with `seed`.
    If `seed` is already a ``Generator`` or ``RandomState`` instance then
    that instance is used.

Returns
-------
resample : (self.d, `size`) ndarray
    The sampled dataset.

)r!   )r!   Úpr;   )ÚintÚneffr   r   r   r
   r$   r'   r>   Úchoicer%   r)   r    )r1   r!   ÚseedÚrandom_stateÚnormÚindicesÚmeanss   &&&    r4   ÚresampleÚgaussian_kde.resampleÎ  s�   € ð. Š<Ü�t—y‘y“>ˆDä)¨$Ó/ˆÜ˜×9Ñ9Ü�4—6‘6�)œUÓ# T§_¡_¸4ð :ó 
ó ˆð ×%Ñ% d§f¡f°4¿<¹<Ð%ÓHˆØ—‘˜Q ˜ZÕ(ˆà�|ÐrH   c                ó^   € \        V P                  RV P                  ^,           ,          4      # )zGCompute Scott's factor.

Returns
-------
s : float
    Scott's factor.
ç      ð¿©r   r|   r$   ©r1   s   &r4   Úscotts_factorÚgaussian_kde.scotts_factorñ  s!   € ô �T—Y‘Y  T§V¡V¨A¥X¥Ó/Ð/rH   c                óœ   € \        V P                  V P                  R,           ,          R,          RV P                  ^,           ,          4      # )zSCompute the Silverman factor.

Returns
-------
s : float
    The silverman factor.
rJ   g      @r†   r‡   rˆ   s   &r4   Úsilverman_factorÚgaussian_kde.silverman_factorû  s3   € ô �T—Y‘Y §¡ s¥
Õ+¨CÕ/°°d·f±f¸QµhµÓ@Ð@rH   a4  Computes the bandwidth factor `factor`.
        The default is `scotts_factor`.  A subclass can overwrite this
        method to provide a different method, or set it through a call to
        `set_bandwidth`.

        Returns
        -------
        factor : float
            The bandwidth factor.
        c                ó„  a a€ Sf   M¨SR8X  d   S P                   S n        M�SR8X  d   S P                  S n        Mv\        P                  ! S4      '       d*   \        S\        4      '       g   RS n        V3R lS n        M1\        S4      '       d   SS n        V 3R lS n        MRp\        V4      hS P                  4        R# )a*  Compute the bandwidth factor with given method.

The new bandwidth calculated after a call to `set_bandwidth` is used
for subsequent evaluations of the estimated density.

Parameters
----------
bw_method : str, scalar or callable, optional
    The method used to calculate the bandwidth factor.  This can be
    'scott', 'silverman', a scalar constant or a callable.  If a
    scalar, this will be used directly as `factor`.  If a callable,
    it should take a `gaussian_kde` instance as only parameter and
    return a scalar.  If None (default), nothing happens; the current
    `covariance_factor` method is kept.

Notes
-----
.. versionadded:: 0.11

Examples
--------
>>> import numpy as np
>>> import scipy.stats as stats
>>> x1 = np.array([-7, -5, 1, 4, 5.])
>>> kde = stats.gaussian_kde(x1)
>>> xs = np.linspace(-10, 10, num=50)
>>> y1 = kde(xs)
>>> kde.set_bandwidth(bw_method='silverman')
>>> y2 = kde(xs)
>>> kde.set_bandwidth(bw_method=kde.factor / 3.)
>>> y3 = kde(xs)

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> ax.plot(x1, np.full(x1.shape, 1 / (4. * x1.size)), 'bo',
...         label='Data points (rescaled)')
>>> ax.plot(xs, y1, label='Scott (default)')
>>> ax.plot(xs, y2, label='Silverman')
>>> ax.plot(xs, y3, label='Const (1/3 * Silverman)')
>>> ax.legend()
>>> plt.show()

NÚscottÚ	silvermanzuse constantc                  ó   <€ S # ©N© r   s   €r4   Ú<lambda>Ú,gaussian_kde.set_bandwidth.<locals>.<lambda>F  s   ø€ ©YrH   c                  ó&   <€ S P                  S 4      # r’   )Ú
_bw_methodrˆ   s   €r4   r”   r•   I  s   ø€ ¨T¯_©_¸TÔ-BrH   zC`bw_method` should be 'scott', 'silverman', a scalar or a callable.)r‰   Úcovariance_factorrŒ   r,   ÚisscalarÚ
isinstanceÚstrr—   Úcallabler"   Ú_compute_covariance)r1   r   r2   s   ff r4   r/   Úgaussian_kde.set_bandwidth  sœ   ù€ ðX ÒØØ˜'Ô!Ø%)×%7Ñ%7ˆDÕ"Ø˜+Ô%Ø%)×%:Ñ%:ˆDÕ"Ü�[Š[˜×#Ò#¬J°yÄ#×,FÒ,FØ,ˆDŒOÜ%6ˆDÕ"Ü�i× Ò Ø'ˆDŒOÜ%BˆDÕ"ð#ˆCä˜S“/Ð!à× Ñ Ö"rH   c           
     ó¼  € V P                  4       V n        \        V R4      '       gY   \        \	        V P
                  ^RV P                  R7      4      V n        \        P                  ! V P                  RR7      V n
        V P                  V P                  ^,          ,          V n        V P                  V P                  ,          P                  \        P                  4      V n        ^\        P                   ! \        P"                  ! V P                  \        P$                  ! ^\&        ,          4      ,          4      4      P)                  4       ,          V n        R# )zSComputes the covariance matrix for each Gaussian kernel using
covariance_factor().
Ú_data_cho_covF©ÚrowvarÚbiasÚaweightsT)ÚlowerN)r˜   ÚfactorÚhasattrr   r   r    r)   Ú_data_covariancer   Úcholeskyr    r>   r&   r,   Úfloat64r@   ÚlogÚdiagr   r   r   Úlog_detrˆ   s   &r4   r�   Ú gaussian_kde._compute_covarianceQ  sì   € ð ×,Ñ,Ó.ˆŒä�t˜_×-Ò-Ü$.¬s°4·<±<ÈØ49Ø8<¿¹ô0Fó %GˆDÔ!ô "(§¢°×1FÑ1FØ7;ô"=ˆDÔð ×/Ñ/°$·+±+¸qµ.Õ@ˆŒØ×*Ñ*¨T¯[©[Õ8×@Ñ@ÄÇÁÓLˆŒØœŸš¤§¢¨¯©Ü*,¯'ª'°!´Bµ$«-õ)8ó !9ó :ß:=¹#»%õ@ˆŽrH   c           	     óþ   € V P                  4       V n        \        \        V P                  ^RV P
                  R7      4      V n        \        P                  ! V P                  4      V P                  ^,          ,          # )r   Fr¡   )	r˜   r¦   r   r   r    r)   r¨   r   Úinvrˆ   s   &r4   Úinv_covÚgaussian_kde.inv_covc  s]   € ð ×,Ñ,Ó.ˆŒÜ *¬3¨t¯|©|ÀAØ05ÀÇÁô,Nó !OˆÔä�zŠz˜$×/Ñ/Ó0°4·;±;Àµ>ÕAÐArH   c                ó$   € V P                  V4      # )a3  
Evaluate the estimated pdf on a provided set of points.

Parameters
----------
x : array_like
    Points at which to evaluate the pdf.

Returns
-------
pdf : ndarray
    The pdf evaluated at `x`.

Notes
-----
This is an alias for `gaussian_kde.evaluate`.  See the ``evaluate``
docstring for more details.

)rF   )r1   Úxs   &&r4   ÚpdfÚgaussian_kde.pdfo  s   € ð( �}‰}˜QÓÐrH   c                óÒ  € \        V4      pVP                  w  r4W0P                  8w  dO   V^8X  d+   W@P                  8X  d   \        W P                  ^34      p^pMRV RV P                   2p\	        V4      h\        V P                  V4      w  rg\        V,          ! V P                  P                  V P                  R,          VP                  V P                  V4      pVR,          # )zÛ
Evaluate the log of the estimated pdf on a provided set of points.

Parameters
----------
x : array_like
    Points at which to evaluate the log-pdf.

Returns
-------
logpdf : ndarray
    The log-pdf evaluated at `x`.
r8   r9   r:   r<   )r   r#   r$   r	   r"   r=   r>   r   r    r?   r)   r@   )	r1   r´   rA   r$   rB   r2   rC   rD   rE   s	   &&       r4   ÚlogpdfÚgaussian_kde.logpdf…  sÀ   € ô ˜A“ˆà�|‰|‰ˆØ—‘Œ;Ø�AŒv˜!Ÿv™vœ+ä  ¯&©&°!¨Ó5�Ø‘à/°¨sð 30Ø04·±¨xð9�ä  “oÐ%ä.¨t¯©ÀÓGÑˆÜ-¨dÖ3Ø�L‰L�N‰N˜DŸL™L¨Õ1Ø�H‰H�d—l‘l Ló2ˆð �d�|ÐrH   c                óš  € \         P                  ! V4      p\         P                  ! VP                  \         P                  4      '       g   Rp\        V4      h\        V P                  4      pVP                  4       pWBV^ 8  ,          ,           W"^ 8  &   \        \         P                  ! V4      4      \        V4      8w  d   Rp\        V4      hV^ 8  W$8¬  ,          p\         P                  ! V4      '       d   RWV,           RV R2p\        V4      hV P                  V,          pV P                  p\        WpP                  4       VR7      # )aº  Return a marginal KDE distribution.

Parameters
----------
dimensions : int or 1-d array_like
    The dimensions of the multivariate distribution corresponding
    with the marginal variables, that is, the indices of the dimensions
    that are being retained. The other dimensions are marginalized out.

Returns
-------
marginal_kde : gaussian_kde
    An object representing the marginal distribution.

Notes
-----
.. versionadded:: 1.10.0

zaElements of `dimensions` must be integers - the indices of the marginal variables being retained.z,All elements of `dimensions` must be unique.zDimensions z# are invalid for a distribution in z dimensions.)r   r)   )r,   r   Ú
issubdtypeÚdtypeÚintegerr"   r+   r    ÚcopyÚuniqueÚanyr)   r   r˜   )	r1   Ú
dimensionsÚdimsr2   r%   Úoriginal_dimsÚ	i_invalidr    r)   s	   &&       r4   ÚmarginalÚgaussian_kde.marginal§  s  € ô* �}Š}˜ZÓ(ˆä�}Š}˜TŸZ™Z¬¯©×4Ò4ð?ˆCä˜S“/Ð!ä�—‘ÓˆØŸ	™	›ˆà $¨¡(�^Õ+ˆ�A‰X‰äŒr�yŠy˜‹Ó¤3 t£9Ô,ØAˆCÜ˜S“/Ð!à˜A‘X $¡)Õ,ˆ	Ü�6Š6�)×ÒØ  Õ!9Ð :ð ;,Ø,-¨3¨lð<ˆCä˜S“/Ð!à—,‘,˜tÕ$ˆØ—,‘,ˆä˜G×/EÑ/EÓ/GØ$+ô-ð 	-rH   c                ó¬   €  V P                   #   \         d;    \        T P                  4      T P                  ,          T n         T P                   u # i ; ir’   )r(   ÚAttributeErrorr   r%   rˆ   s   &r4   r)   Úgaussian_kde.weightsØ  sB   € ð	!Ø—=‘=Ð øÜô 	!Ü  §¡›L¨¯©Õ/ˆDŒMØ—=‘=Ò ð	!ús   ‚ ŽAAÁAc                óÄ   €  V P                   #   \         dG    ^\        P                  ! T P                  T P                  4      ,          T n         T P                   u # i ; i)r   )r.   rÈ   r,   r-   r)   rˆ   s   &r4   r|   Úgaussian_kde.neffà  sI   € ð	Ø—:‘:ÐøÜô 	Øœ2Ÿ9š9 T§\¡\°4·<±<Ó@Õ@ˆDŒJØ—:‘:Òð	ús   ‚ ŽAAÁAc                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )é   Ú__class_getitem__)Úclassmethod)ÚformatÚ__classdict__s   "€r4   Ú__annotate__Úgaussian_kde.__annotate__&   s   ø‡ ‚ ñ^ #Ñ>ò_ rH   )r—   r    r¨   r.   r(   r@   r>   r˜   r$   r    r¦   r­   r%   )NNr’   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rÏ   r   rÎ   r5   rF   Ú__call__rY   rd   ro   rw   rƒ   r‰   rŒ   r˜   r/   r�   Úpropertyr±   rµ   r¸   rÅ   r)   r|   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)rÑ   s   @r4   r   r   &   sÑ   ø‡ € ñkñ\ &1°Ó%>Ðô$1òL&ðP €Hò3òj ñD8Èõ 8ò<0ôd!òF0òAð &Ðð	!ÐÔô=#ò~@ð$ ñ	Bó ð	Bò ò, òD/-ðb ñ!ó ð!ð ñó ð÷w ƒ rH   c                óÖ   € \         P                  ! W4      p\         P                  ! V4      P                  pV^8X  d   RpW$3# V^8X  d   RpW$3# VR9   d   RpW$3# \	        V RV 24      h)zÂ
Calculates the output dtype and the "spec" (=C type name).

This was necessary in order to deal with the fused types in the Cython
routine `gaussian_kernel_estimate`. See gh-10824 for details.
r'   Údoublezlong doublez has unexpected item size: )é   é   )r,   Úcommon_typer¼   Úitemsizer"   )r>   rA   rC   rã   rD   s   &&   r4   r=   r=   é  sŽ   € ô —>’> *Ó5€LÜ�xŠx˜Ó%×.Ñ.€HØ�1„}Øˆð ÐÐð 
�QŒØˆð ÐÐð 
�XÔ	Øˆð ÐÐô	 Ø�.Ð ;¸H¸:ÐFóð 	rH   )!Útypesr   Úscipyr   r   Úscipy._lib._utilr   Únumpyr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r,   Ú_statsr   r   Ú_multivariater   Ú__all__r   r=   r“   rH   r4   Ú<module>rë      sS   ðõ( ÷ "Ý /÷÷ ÷ ÷ ó ó ÷ KÝ .àÐ
€÷@ñ @ôFrH   