std
概率分布的标准差
说明
示例
拟合分布的标准差
加载样本数据。创建包含学生考试成绩数据第一列的向量。
load examgrades
x = grades(:,1);
对数据进行正态分布对象拟合。
pd = fitdist(x,'Normal')
pd = NormalDistribution Normal distribution mu = 75.0083 [73.4321, 76.5846] sigma = 8.7202 [7.7391, 9.98843]
计算拟合分布的标准差。
s = std(pd)
s = 8.7202
对于正态分布,标准差等于参数 sigma
。
偏态分布的标准差
创建威布尔概率分布对象。
pd = makedist('Weibull','A',5,'B',2)
pd = WeibullDistribution Weibull distribution A = 5 B = 2
计算分布的标准差。
s = std(pd)
s = 2.3163
三角分布的标准差
创建一个三角分布对象。
pd = makedist('Triangular','A',-3,'B',1,'C',3)
pd = TriangularDistribution A = -3, B = 1, C = 3
计算分布的标准差。
s = std(pd)
s = 1.2472
核分布的标准差
加载样本数据。创建包含学生考试成绩数据的第一列的向量。
load examgrades;
x = grades(:,1);
通过对数据进行核分布拟合来创建一个概率分布对象。
pd = fitdist(x,'Kernel')
pd = KernelDistribution Kernel = normal Bandwidth = 3.61677 Support = unbounded
计算拟合分布的标准差。
s = std(pd)
s = 9.4069
输入参数
pd
— 概率分布
概率分布对象
概率分布,指定为下表中的概率分布对象之一。
输出参量
s
— 标准差
非负标量值
概率分布的标准差,以非负标量值形式返回。
扩展功能
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
用法说明和限制:
输入参量
pd
可以是 beta、指数、极值、对数正态、正态和威布尔分布的拟合概率分布对象。通过对来自fitdist
函数的样本数据进行概率分布拟合,创建pd
。有关示例,请参阅Code Generation for Probability Distribution Objects。
有关代码生成的详细信息,请参阅 Introduction to Code Generation 和 General Code Generation Workflow。
GPU 数组
通过使用 Parallel Computing Toolbox™ 在图形处理单元 (GPU) 上运行来加快代码执行。
此函数完全支持 GPU 数组。有关详细信息,请参阅Run MATLAB Functions on a GPU (Parallel Computing Toolbox)。
版本历史记录
在 R2013a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)