Multivariate kernel density estimator.
This density estimator can handle univariate as well as multivariate data, including mixed continuous / ordered discrete / unordered discrete data. It also provides cross-validated bandwidth selection methods (least squares, maximum likelihood).
Parameters : | data: list of ndarrays or 2-D ndarray :
var_type: str :
bw: array_like or str, optional :
defaults: EstimatorSettings instance, optional :
|
---|
See also
Examples
>>> import statsmodels.api as sm
>>> nobs = 300
>>> np.random.seed(1234) # Seed random generator
>>> c1 = np.random.normal(size=(nobs,1))
>>> c2 = np.random.normal(2, 1, size=(nobs,1))
Estimate a bivariate distribution and display the bandwidth found:
>>> dens_u = sm.nonparametric.KDEMultivariate(data=[c1,c2],
... var_type='cc', bw='normal_reference')
>>> dens_u.bw
array([ 0.39967419, 0.38423292])
Attributes
bw: array_like | The bandwidth parameters. |
Methods
cdf([data_predict]) | Evaluate the cumulative distribution function. |
imse(bw) | Returns the Integrated Mean Square Error for the unconditional KDE. |
loo_likelihood(bw[, func]) | Returns the leave-one-out likelihood function. |
pdf([data_predict]) | Evaluate the probability density function. |