class statsmodels.nonparametric.kernel_density.KDEMultivariateConditional(endog, exog, dep_type, indep_type, bw, defaults=<statsmodels.nonparametric._kernel_base.EstimatorSettings object>)
[source]
Conditional multivariate kernel density estimator.
Calculates P(Y_1,Y_2,...Y_n | X_1,X_2...X_m) =
P(X_1, X_2,...X_n, Y_1, Y_2,..., Y_m)/P(X_1, X_2,..., X_m)
. The conditional density is by definition the ratio of the two densities, see [1].
Parameters: |
|
---|
bw
array_like – The bandwidth parameters
See also
[1] | http://en.wikipedia.org/wiki/Conditional_probability_distribution |
>>> import statsmodels.api as sm >>> nobs = 300 >>> c1 = np.random.normal(size=(nobs,1)) >>> c2 = np.random.normal(2,1,size=(nobs,1))
>>> dens_c = sm.nonparametric.KDEMultivariateConditional(endog=[c1], ... exog=[c2], dep_type='c', indep_type='c', bw='normal_reference') >>> dens_c.bw # show computed bandwidth array([ 0.41223484, 0.40976931])
cdf ([endog_predict, exog_predict]) | Cumulative distribution function for the conditional density. |
imse (bw) | The integrated mean square error for the conditional KDE. |
loo_likelihood (bw[, func]) | Returns the leave-one-out conditional likelihood of the data. |
pdf ([endog_predict, exog_predict]) | Evaluate the probability density function. |
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.nonparametric.kernel_density.KDEMultivariateConditional.html