localpoly.utils package

Submodules

localpoly.utils.helpers module

localpoly.utils.helpers.bspline(x, y, sections, degree=3)[source]
localpoly.utils.helpers.chunks(lst, n)[source]

Yield successive n-sized chunks from lst.

localpoly.utils.helpers.create_partitions(X, y, n_sections, sampling_type)[source]
localpoly.utils.helpers.sort_values_by_X(X, y)[source]

localpoly.utils.kernels module

localpoly.utils.kernels.epanechnikov_kernel(x, Xi, h)[source]

Epanechnikov kernel

\(K(u) = \frac{3}{4} \left( 1 - u^2 \right)\) where \(u = \frac {x - X_i}{h}\)

Parameters
  • x (float) – point of interest

  • Xi (array) – data points, surrounding of x

  • h (float) – bandwidth

Returns

Kernel function for the point x

Return type

ndarray

localpoly.utils.kernels.gaussian_kernel(x, Xi, h)[source]

Gaussian Kernel.

\(K(u) = \frac{1}{\sqrt{2\pi}} e^{-\frac{1}{2} u^2}\) where \(u = \frac {x - X_i}{h}\)

Parameters
  • x (float) – point of interest

  • Xi (array) – data points, surrounding of x

  • h (float) – bandwidth

Returns

Kernel function for the point x

Return type

ndarray

Module contents