Module pyqt_fit.nonparam_regression — PyQt-Fit 1.3.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- PyQt-Fit 1.3.1 documentation »
- Modules of PyQt-Fit »

\[\DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\argmin}{argmin} \newcommand{\R}{\mathbb{R}} \newcommand{\n}{\boldsymbol{n}}\]

# Module `pyqt_fit.nonparam_regression`

Author: | Pierre Barbier de Reuille <pierre.barbierdereuille@gmail.com>

Module implementing non-parametric regressions using kernel methods.

class `pyqt_fit.nonparam_regression.` `NonParamRegression`(xdata, ydata, **kwords)

  Class performing kernel-based non-parametric regression.

  The calculation is split in three parts:

  > - The kernel (`kernel`)
  > - Bandwidth computation (`bandwidth`, `covariance`)
  > - Regression method (`method`)

  `N`

    Number of points in the dataset (set by the fitting)

  `bandwidth`

    Bandwidth of the kernel.

    This is defined as the square root of the covariance matrix

  `covariance`

    Covariance matrix of the kernel.

    It must be of the right dimension!

  `dim`

    Dimension of the domain (set by the fitting)

  `fit`()

    Method to call to fit the parameters of the fitting

  `fitted`

    Check if the fitting needs to be performed.

  `fitted_method`

    Method actually used after fitting.

    The main method may choose to provide a more tuned method during fitting.

  `kernel`

    Kernel object. Should provide the following methods:

    `kernel.pdf(xs)`
      Density of the kernel, denoted \(K(x)\)
  `kernel_type`

    Type of the kernel. The kernel type is a class or function accepting the dimension of the domain as argument and returning a valid kernel object.

  `lower`

    Lower bound of the domain for each dimension

  `method`

    Regression method itself. It should be an instance of the class following the template `pyqt_fit.npr_methods.RegressionKernelMethod`.

  `need_fit`()

    Calling this function will mark the object as needing fitting.

  `set_actual_bandwidth`(bandwidth, covariance)

    Method computing the bandwidth if needed (i.e. if it was defined by functions)

  `upper`

    Lower bound of the domain for each dimension

  `xdata`

    2D array (D,N) with D the dimension of the domain and N the number of points.

  `ydata`

    1D array (N,) of values for each point in xdata

### Navigation

- index
- modules |
- next |
- previous |
- PyQt-Fit 1.3.1 documentation »
- Modules of PyQt-Fit »