当前位置:网站首页>MCS:连续随机变量——Student’s t分布
MCS:连续随机变量——Student’s t分布
2022-06-23 03:56:00 【今晚打佬虎】
Student’s t
Student’s t分布也是一个很重要的分布在统计分析中,常用于检验变量均值的显著性。Student’s t分布也叫做t分布,与标准的正态分布类似,但是尾部可以向左右延申,取决于参数 k k k自由度。
t分布的期望和方差:
E ( t ) = 0 E(t) = 0 E(t)=0
V ( t ) = k k − 2 , k > 2 V(t) = \frac{k}{k - 2},k > 2 V(t)=k−2k,k>2
t分布性质:
- 当 k > 30 k > 30 k>30时,t分布近似于标准的正态分布。
- t、chi-Square和标准正态分布之间的关系:
t = z X 2 / k t = \frac{z}{\sqrt{\mathcal X^2 / k}} t=X2/kz
生成服从t分布的随机变量
- 生成一个标准的正态变量: z ∼ N ( 0 , 1 ) z \sim N(0, 1) z∼N(0,1)
- 生成一个自由度为k的Chi-Square变量: X k 2 \mathcal X_k^2 Xk2
- t = z / X k 2 / k t = z / \sqrt{\mathcal X_k^2 / k} t=z/Xk2/k
- Return t.
例:生成一个自由度为6的t变量:
- z = 0.71 z = 0.71 z=0.71
- X 6 2 = 6.29 \mathcal X_6^2 = 6.29 X62=6.29
- t = 0.71 / 6.29 / 6 = 0.693 t = 0.71 / \sqrt{6.29/6} = 0.693 t=0.71/6.29/6=0.693
- t = 0.693 t = 0.693 t=0.693
import numpy as np
import matplotlib.pyplot as plt
def generate_t_var(k=1):
z = np.random.normal(0, 1)
if k < 30:
c = (np.random.normal(0, 1, size=(k))**2).sum()
t = z / np.sqrt(c / k)
else:
z_ = np.random.normal(0, 1)
c = int(k + z_ * np.sqrt(2*k) + 0.5)
t = z / np.sqrt(c / k)
return t
k = 1 、 10 、 30 、 50 k = 1、10、30、50 k=1、10、30、50

边栏推荐
- 导出带水印的PDF
- Fund performance evaluation
- Complete the primary school project in 3 days, and teach you to complete the weather broadcast system hand in hand!
- 同步国内AOSP代码相关错误
- Servlet self study notes
- servlet自学笔记
- LeetCode-1757. 可回收且低脂的产品_SQL
- BGP summary of hcip operation
- 【opencv450】帧间差分法
- 8 years' experience: monthly salary of 3000 to 30000, the change of Test Engineer
猜你喜欢

VMware network connection error unit network service not found

飞桨框架v2.3发布高可复用算子库PHI!重构开发范式,降本增效

C'est dur de trouver un emploi? Ali des trois côtés, heureusement qu'il s'est bien préparé et qu'il a pris un produit.

pkav简单爆破

搭建一套 gocd 的环境

Three methods of GNSS velocity calculation

Web 应用程序安全测试指南

【Leetcode】最长递增子序列问题及应用

直接插入排序——【常见排序法(1/8)】

HCIP 重发布实验
随机推荐
OSPF shunt test
Penetration test basis | attached test points and test scenarios
【Leetcode】最长递增子序列问题及应用
Image noise reduction denoise AI
Drag and drop frame
Mongodb sharding principle
Web 应用程序安全测试指南
Error related to synchronizing domestic AOSP code
What is the average annual salary of an outsourced tester who has worked for 5-8 years?
Ams:startactivity desktop launch application
TIOBE 编程语言排行榜是编程语言流行趋势的一个指标
Servlet self study notes
STM32cube 串口使用DMA+IDLE接收不定长数据
pygame音乐相关的功能实现
bat中获取bat命令结果
(IntelliJ)插件一 Background Image Plus
BGP second test
架构师之路,从「存储选型」起步
MVC three-tier architecture
物联网开源开发平台 Shifu 开放内测!第一版技术文档发布