Input data, specified as a column vector. `fitdist`

ignores `NaN`

values
in `x`

. Additionally, any `NaN`

values
in the censoring vector or frequency vector causes `fitdist`

to
ignore the corresponding values in `x`

.

**Data Types: **`single`

| `double`

Distribution name, specified as one of the following strings.
The distribution specified by `distname`

determines
the class type of the returned probability distribution object.

Grouping variable, specified as a categorical array, logical
or numeric vector, or cell array of strings. Each unique value in
a grouping variable defines a group.

For example, if `Gender`

is a cell array of
strings with values `'Male'`

and `'Female'`

,
you can use `Gender`

as a grouping variable to fit
a distribution to your data by gender.

More than one grouping variable can be used by specifying a
cell array of grouping variable names. Observations are placed in
the same group if they have common values of all specified grouping
variables.

For example, if `Smoker`

is a logical vector
with values `0`

for nonsmokers and `1`

for
smokers, then specifying the cell array `{Gender,Smoker}`

divides
observations into four groups: Male Smoker, Male Nonsmoker, Female
Smoker, and Female Nonsmoker.

**Example: **`{Gender,Smoker}`

**Data Types: **`single`

| `double`

| `logical`

| `cell`

| `char`

Specify optional comma-separated pairs of `Name,Value`

arguments.
`Name`

is the argument
name and `Value`

is the corresponding
value. `Name`

must appear
inside single quotes (`' '`

).
You can specify several name and value pair
arguments in any order as `Name1,Value1,...,NameN,ValueN`

.

**Example: **`fitdist(x,'Kernel','Kernel','triangle')`

fits
a kernel distribution object to the data in `x`

using
a triangular kernel function.
Logical flag for censored data, specified as the comma-separated
pair consisting of `'Censoring'`

and a vector of
logical values that is the same size as input vector `x`

.
The value is `1`

when the corresponding element in `x`

is
a right-censored observation and `0`

when the corresponding
elements is an exact observation. The default is a vector of `0`

s,
indicating that all observations are exact.

`fitdist`

ignores any `NaN`

values
in this censoring vector. Additionally, any `NaN`

values
in `x`

or the frequency vector causes `fitdist`

to
ignore the corresponding values in the censoring vector.

**Data Types: **`logical`

Observation frequency, specified as the comma-separated pair
consisting of `'Frequency'`

and a vector of nonnegative
integer values that is the same size as input vector `x`

.
Each element of the frequency vector specifies the frequencies for
the corresponding elements in `x`

. The default
is a vector of `1`

s, indicating that each value in `x`

only
appears once.

`fitdist`

ignores any `NaN`

values
in this frequency vector are ignored by the fitting calculations.
Additionally, any `NaN`

values in `x`

or
the censoring vector causes `fitdist`

to ignore the
corresponding values in the frequency vector.

**Data Types: **`logical`

Control parameters for the iterative fitting algorithm, specified
as the comma-separated pair consisting of `'Options'`

and
a structure you create using `statset`

.

**Data Types: **`struct`

Number of trials for the binomial distribution, specified as
the comma-separated pair consisting of `'NTrials'`

and
a positive integer value. You must specify `distname`

as `'Binomial'`

to
use this option.

**Data Types: **`single`

| `double`

Threshold parameter for the generalized Pareto distribution,
specified as the comma-separated pair consisting of `'Theta'`

and
a scalar value. You must specify `distname`

as `'GeneralizedPareto'`

to
use this option.

**Data Types: **`single`

| `double`

Kernel smoother type, specified as the comma-separated pair
consisting of `'Kernel'`

and one of the following:

`'normal'`

`'box'`

`'triangle'`

`'epanechnikov'`

You must specify `distname`

as `'Kernel'`

to
use this option.

Kernel density support, specified as the comma-separated pair
consisting of `'Support'`

and a string or two-element
vector. The string must be one of the following.

`'unbounded'` | Density can extend over the whole real line. |

`'positive'` | Density is restricted to positive values. |

Alternatively, you can specify a two-element vector giving finite
lower and upper limits for the support of the density.

You must specify `distname`

as `'Kernel'`

to
use this option.

**Data Types: **`single`

| `double`

Bandwidth of the kernel smoothing window, specified as the comma-separated
pair consisting of `'Width'`

and a scalar value.
The default value used by `fitdist`

is optimal for
estimating normal densities, but you might want to choose a smaller
value to reveal features such as multiple modes. You must specify `distname`

as `'Kernel'`

to
use this option.

**Data Types: **`single`

| `double`