Kernel density estimation in 1D

KernelDensity1D distribution

Description

The kernel density distribution in 1D object defines a kernel density with the provided data vector x\mathbf{x}, the kernel function K(.)K(.), and the bandwidth hh. The probability density of a kernel density is given by:

f^h(x)=1nhi=1nK(xxih) \hat{f}_h(x) = \frac{1}{nh} \sum_{i=1}^{n} K(\frac{x-x_i}{h})(1)

where nn is the number of data points in the data vector. Currently, the Gaussian and the Uniform kernel functions are implemented. For the bandwidth, the user can either provide a value or request an automatic computation using the data standard deviation or the Silverman's rule.

Example Input Syntax

The following input file defines a kernel density distribution with kernel_density_1D_input.csv as an example data input, Gaussian as the kernel function, and Silverman's rule for the bandwidth. The data in kernel_density_1D_input.csv were drawn from a Normal distribution with a mean and standard deviation of unity.

[Distributions]
  [kernel1d_test]
    type = KernelDensity1D
    bandwidth_rule = 'silverman'
    kernel_function = 'gaussian'
    file_name = 'kernel_density_1D_input.csv'
  []
[]
(contrib/moose/modules/stochastic_tools/test/tests/distributions/kernel_density_1d_gaussian.i)

Input Parameters

  • bandwidth_ruleBandwidth rule for evaluating the bandwith.

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:silverman, standarddeviation, userdefined

    Controllable:No

    Description:Bandwidth rule for evaluating the bandwith.

  • kernel_functionKernel function determines the shape of the underlying kernel for the kernel density.

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:gaussian, uniform

    Controllable:No

    Description:Kernel function determines the shape of the underlying kernel for the kernel density.

Required Parameters

  • bandwidth1Bandwidth controls the smoothness of the kernel density.

    Default:1

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Bandwidth controls the smoothness of the kernel density.

  • dataThe data vector.

    C++ Type:std::vector<double>

    Unit:(no unit assumed)

    Controllable:No

    Description:The data vector.

  • file_column_nameName of column in csv file to use, by default first column is used.

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of column in csv file to use, by default first column is used.

  • file_nameName of the CSV file.

    C++ Type:FileName

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of the CSV file.

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters