tinv
Student t 逆累积分布函数
说明
示例
计算 Student t icdf
为多个分布计算 Student t icdf
计算自由度为 1
到 6
的 Student t 分布的第 99 个百分位数。
percentile = tinv(0.99,1:6)
percentile = 1×6
31.8205 6.9646 4.5407 3.7469 3.3649 3.1427
使用 Student t icdf 计算置信区间
使用 tinv
找到估计总体均值的 95% 置信区间。
生成一个从均值为 10
和标准差为 2
的正态总体中抽取的大小为 100
的随机样本。
mu = 10; sigma = 2; n = 100; rng default % For reproducibility x = normrnd(mu,sigma,n,1);
计算样本均值、标准差和自由度。
xbar = mean(x); se = std(x)/sqrt(n); nu = n - 1;
找出 95%
置信区间的置信边界上限和置信边界下限。
conf = 0.95; alpha = 1 - conf; pLo = alpha/2; pUp = 1 - alpha/2;
计算置信边界的临界值。
crit = tinv([pLo pUp], nu);
确定总体均值的置信区间。
ci = xbar + crit*se
ci = 1×2
9.7849 10.7075
此置信区间与对样本来自均值为 mu
的正态总体的原假设进行 t
检验所返回的 ci
值相同。
[h,p,ci2] = ttest(x,mu,'Alpha',alpha);
ci2
ci2 = 2×1
9.7849
10.7075
输入参数
p
— 用于计算 icdf 的概率值
[0,1]
中的标量值 | 标量值组成的数组
输出参量
详细信息
Student t icdf
Student t 分布是单参数曲线族。参数 ν 是自由度。Student t 分布的均值为零。
根据 Student t cdf,t 逆函数定义为
其中
ν 是自由度,Γ( · ) 是 gamma 函数。结果 x 是需提供概率 p 的积分方程的解。
有关详细信息,请参阅Student's t Distribution。
替代功能
tinv
是 Student t 分布特有的函数。Statistics and Machine Learning Toolbox™ 还提供泛型函数icdf
,它支持各种概率分布。要使用icdf
,请指定概率分布名称及其参数。请注意,分布特有的函数tinv
比泛型函数icdf
的执行速度要快。
扩展功能
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)