# KernelDistribution

## 说明

`Kernel`核函数类型`normal`, `box`, `triangle`, `epanechnikov`
`Bandwidth`核平滑参数`Bandwidth > 0`

## 属性

### 其他对象属性

• `data`:用于分布拟合的数据向量。

• `cens`:删失向量，如果没有，则为空。

• `freq`:频率向量，如果没有，则为空。

## 对象函数

 `cdf` 累积分布函数 `gather` Gather properties of Statistics and Machine Learning Toolbox object from GPU `icdf` 逆累积分布函数 `iqr` Interquartile range of probability distribution `mean` 概率分布的均值 `median` Median of probability distribution `negloglik` Negative loglikelihood of probability distribution `pdf` 概率密度函数 `plot` Plot probability distribution object `random` 随机数 `std` 概率分布的标准差 `truncate` Truncate probability distribution object `var` Variance of probability distribution

## 示例

```load hospital histogram(hospital.Weight)```

`pd_kernel = fitdist(hospital.Weight,'Kernel')`
```pd_kernel = KernelDistribution Kernel = normal Bandwidth = 14.3792 Support = unbounded ```

`pd_normal = fitdist(hospital.Weight,'Normal')`
```pd_normal = NormalDistribution Normal distribution mu = 154 [148.728, 159.272] sigma = 26.5714 [23.3299, 30.8674] ```

```x = 50:1:250; pdf_kernel = pdf(pd_kernel,x); pdf_normal = pdf(pd_normal,x);```

```plot(x,pdf_kernel,'Color','b','LineWidth',2); hold on; plot(x,pdf_normal,'Color','r','LineStyle',':','LineWidth',2); legend('Kernel Distribution','Normal Distribution','Location','SouthEast'); hold off;```