# density_kernel (MathScript RT Module Function)

LabVIEW 2012 MathScript RT模块帮助

»查看产品信息

Owning Class: statistics

Requires: MathScript RT Module

## Syntax

d = density_kernel(x)

d = density_kernel(x, xi)

d = density_kernel(x, xi, 'pName', pValue...)

[d, xo] = density_kernel(x)

[d, xo] = density_kernel(x, xi)

[d, xo] = density_kernel(x, xi, 'pName', pValue...)

[d, xo, w] = density_kernel(x)

[d, xo, w] = density_kernel(x, xi)

[d, xo, w] = density_kernel(x, xi, 'pName', pValue...)

Legacy Name: ksdensity

## Description

Computes the probability density estimate of the input vector.

Examples

## Inputs

Name Description
x Specifies a real vector of sample points.
xi Specifies the points where the probability density is estimated.
pName/pValue Specifies one or more property name/value pairs that control the probability density estimation. pName is a string that accepts the following values:

'kernel' pValue specifies the kernel window used in the density estimation process. pValue is a string that accepts the following values:

 'normal' (default) Use the normal function as the kernel window. 'box' Use the rectangle function as the kernel window. 'triangle' Use the triangle function as the kernel window. 'epanechnikov' Use the epanechnikov function as the kernel window.
'npoints' pValue specifies the length of xi. The default is 100.
'width' pValue specifies the width of the kernel window.

## Outputs

Name Description
d Returns the probability density values estimated at xo.
xo Returns the points where the probability density is estimated.
w Returns the width of the kernel window.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

## Examples

X = randnormal(1, 128);
Y = density_kernel(X);

﻿