nonparametric.smoothers_lowess.lowess()

statsmodels.nonparametric.smoothers_lowess.lowess statsmodels.nonparametric.smoothers_lowess.lowess(endog, exog, frac=0.6666666666666666, it=3, delta=0.0, is_sorted=False, missing='drop', return_sorted=True) [source] LOWESS (Locally Weighted Scatterplot Smoothing) A lowess function that outs smoothed estimates of endog at the given exog values from points (exog, endog) Parameters: endog: 1-D numpy array : The y-values of the observed points exog: 1-D numpy array : The x-values of the obs

nonparametric.kernel_regression.KernelReg()

statsmodels.nonparametric.kernel_regression.KernelReg class statsmodels.nonparametric.kernel_regression.KernelReg(endog, exog, var_type, reg_type='ll', bw='cv_ls', defaults=) [source] Nonparametric kernel regression class. Calculates the conditional mean E[y|X] where y = g(X) + e. Note that the ?local constant? type of regression provided here is also known as Nadaraya-Watson kernel regression; ?local linear? is an extension of that which suffers less from bias issues at the edge of the supp

nonparametric.kernel_regression.KernelCensoredReg()

statsmodels.nonparametric.kernel_regression.KernelCensoredReg class statsmodels.nonparametric.kernel_regression.KernelCensoredReg(endog, exog, var_type, reg_type, bw='cv_ls', censor_val=0, defaults=) [source] Nonparametric censored regression. Calculates the condtional mean E[y|X] where y = g(X) + e, where y is left-censored. Left censored variable Y is defined as Y = min {Y', L} where L is the value at which Y is censored and Y' is the true value of the variable. Parameters: endog: list wi

nonparametric.kernel_density.KDEMultivariateConditional()

statsmodels.nonparametric.kernel_density.KDEMultivariateConditional class statsmodels.nonparametric.kernel_density.KDEMultivariateConditional(endog, exog, dep_type, indep_type, bw, defaults=) [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 [R8]. Parameters: endog: list of ndarrays or 2-D ndarray :

nonparametric.kernel_density.EstimatorSettings()

statsmodels.nonparametric.kernel_density.EstimatorSettings class statsmodels.nonparametric.kernel_density.EstimatorSettings(efficient=False, randomize=False, n_res=25, n_sub=50, return_median=True, return_only_bw=False, n_jobs=-1) Object to specify settings for density estimation or regression. EstimatorSettings has several proporties related to how bandwidth estimation for the KDEMultivariate, KDEMultivariateConditional, KernelReg and CensoredKernelReg classes behaves. Parameters: efficien

nonparametric.kernel_density.KDEMultivariate()

statsmodels.nonparametric.kernel_density.KDEMultivariate class statsmodels.nonparametric.kernel_density.KDEMultivariate(data, var_type, bw=None, defaults=) [source] 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 nda

nonparametric.bandwidths.select_bandwidth()

statsmodels.nonparametric.bandwidths.select_bandwidth statsmodels.nonparametric.bandwidths.select_bandwidth(x, bw, kernel) [source] Selects bandwidth for a selection rule bw this is a wrapper around existing bandwidth selection rules Parameters: x : array-like Array for which to get the bandwidth bw : string name of bandwidth selection rule, currently supported are: normal_reference, scott, silverman kernel : not used yet Returns: bw : float The estimate of the bandwidth

nonparametric.kde.KDEUnivariate()

statsmodels.nonparametric.kde.KDEUnivariate class statsmodels.nonparametric.kde.KDEUnivariate(endog) [source] Univariate Kernel Density Estimator. Parameters: endog : array-like The variable for which the density estimate is desired. See also KDEMultivariate, kdensity, kdensityfft Notes If cdf, sf, cumhazard, or entropy are computed, they are computed based on the definition of the kernel rather than the FFT approximation, even if the density is fit with FFT = True. KDEUnivariate is mu

Nonparametric Methods nonparametric

Nonparametric Methods nonparametric This section collects various methods in nonparametric statistics. This includes kernel density estimation for univariate and multivariate data, kernel regression and locally weighted scatterplot smoothing (lowess). sandbox.nonparametric contains additional functions that are work in progress or don?t have unit tests yet. We are planning to include here nonparametric density estimators, especially based on kernel or orthogonal polynomials, smoothers, and tool

nonparametric.bandwidths.bw_silverman()

statsmodels.nonparametric.bandwidths.bw_silverman statsmodels.nonparametric.bandwidths.bw_silverman(x, kernel=None) [source] Silverman?s Rule of Thumb Parameters: x : array-like Array for which to get the bandwidth kernel : CustomKernel object Unused Returns: bw : float The estimate of the bandwidth Notes Returns .9 * A * n ** (-1/5.) where A = min(std(x, ddof=1), IQR/1.349) IQR = np.subtract.reduce(np.percentile(x, [75,25])) References Silverman, B.W. (1986) Density Estimation.