6.5.5.2.1. statsmodels.sandbox.nonparametric.kernel_extras.gpke

statsmodels.sandbox.nonparametric.kernel_extras.gpke(bw, data, data_predict, var_type, ckertype='gaussian', okertype='wangryzin', ukertype='aitchisonaitken', tosum=True)[source]
Returns the non-normalized Generalized Product Kernel Estimator
Parameters:

bw: 1-D ndarray

The user-specified bandwidth parameters.

data: 1D or 2-D ndarray

The training data.

data_predict: 1-D ndarray

The evaluation points at which the kernel estimation is performed.

var_type: str, optional

The variable type (continuous, ordered, unordered).

ckertype: str, optional

The kernel used for the continuous variables.

okertype: str, optional

The kernel used for the ordered discrete variables.

ukertype: str, optional

The kernel used for the unordered discrete variables.

tosum
: bool, optional

Whether or not to sum the calculated array of densities. Default is True.

Returns:

dens: array-like

The generalized product kernel density estimator.

rac{1}{nh_{1}...h_{q}}sum_{i=1}^
{n}Kleft(

rac{X_{i}-x}{h} ight)

where

\[K\left(\]

rac{X_{i}-x}{h} ight) =

kleft(

rac{X_{i1}-x_{1}}{h_{1}} ight) imes

kleft(

rac{X_{i2}-x_{2}}{h_{2}} ight) imes... imes

kleft(

rac{X_{iq}-x_{q}}{h_{q}} ight)