Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Kernel smoothing function estimate for univariate and bivariate data

```
[f,xi]
= ksdensity(x)
```

```
[f,xi]
= ksdensity(x,pts)
```

```
[f,xi]
= ksdensity(x,pts,Name,Value)
```

```
[f,xi,bw]
= ksdensity(___)
```

`ksdensity(___)`

`ksdensity(ax,___)`

`[`

returns a probability
density estimate, `f`

,`xi`

]
= ksdensity(`x`

)`f`

, for the sample data in the
vector or two-column matrix `x`

. The estimate is
based on a normal kernel function, and is evaluated at equally-spaced
points, `xi`

, that cover the range of the data
in `x`

. `ksdensity`

estimates
the density at 100 points for univariate data, or 900 points for bivariate
data.

`ksdensity`

works best with continuously
distributed samples.

`[`

returns
a probability density estimate, `f`

,`xi`

]
= ksdensity(`x`

,`pts`

,`Name,Value`

)`f`

, for the sample
in the vector or two-column matrix `x`

, with additional
options specified by one or more `Name,Value`

pair
arguments.

For example, you can define the function type `ksdensity`

evaluates,
such as probability density, cumulative probability, survivor function,
and so on. Or you can specify the bandwidth of the smoothing window.

[1] Bowman, A. W., and A. Azzalini. *Applied
Smoothing Techniques for Data Analysis*. New York: Oxford
University Press Inc., 1997.

Was this topic helpful?