chi2pdf
卡方概率密度函数
说明
示例
计算卡方 pdf
计算自由度为 3
的卡方分布中观测值 2 的密度。
y1 = chi2pdf(2,3)
y1 = 0.2076
计算自由度为 1
到 6 的卡方分布中观测值 4
的密度。
y2 = chi2pdf(4,1:6)
y2 = 1×6
0.0270 0.0677 0.1080 0.1353 0.1440 0.1353
卡方分布的均值等于自由度。计算自由度为 1
到 6
的卡方分布的均值密度。
nu = 1:6; x = nu; y3 = chi2pdf(x,nu)
y3 = 1×6
0.2420 0.1839 0.1542 0.1353 0.1220 0.1120
随着自由度的增加,均值的密度降低。
输入参数
输出参量
详细信息
卡方 pdf
替代功能
chi2pdf
是卡方分布特有的函数。Statistics and Machine Learning Toolbox™ 还提供泛型函数pdf
,它支持各种概率分布。要使用pdf
,请指定概率分布名称及其参数。请注意,分布特有的函数chi2pdf
比泛型函数pdf
的执行速度要快。使用 Probability Distribution Function 为概率分布创建累积分布函数 (cdf) 或概率密度函数 (pdf) 的交互图。
扩展功能
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
GPU 数组
通过使用 Parallel Computing Toolbox™ 在图形处理单元 (GPU) 上运行来加快代码执行。
此函数完全支持 GPU 数组。有关详细信息,请参阅Run MATLAB Functions on a GPU (Parallel Computing Toolbox)。
版本历史记录
在 R2006a 之前推出
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)