当前位置:网站首页>MCS: multivariate random variable polynomial distribution
MCS: multivariate random variable polynomial distribution
2022-06-29 15:13:00 【Fight the tiger tonight】
Multinomial polynomial
Suppose an experiment has k k k Two independent results : R 1 , R 2 , . . . R k R_1, R_2, ... R_k R1,R2,...Rk The corresponding probabilities of occurrence are : p 1 , p 2 , . . . p k p_1, p_2, ...p_k p1,p2,...pk. And ∑ i = 1 k p i = 1.0 \sum_{i=1}^k p_i = 1.0 ∑i=1kpi=1.0. Independent repetition n n n Experiments , The number of times each experimental result occurs can be expressed as a random variable x 1 , x 2 , . . x k x_1, x_2, .. x_k x1,x2,..xk To express , ∑ i = 1 k x i = n \sum_{i=1}^k x_i = n ∑i=1kxi=n.
x i x_i xi Probability distribution of :
P ( x 1 , . . . , x k ) = n ! [ x 1 ! . . . x k ! ] p 1 x 1 . . . p k x k P(x_1, ..., x_k) = \frac{n!}{[x_1!...x_k!]p_1^{x_1} ... p_k^{x_k}} P(x1,...,xk)=[x1!...xk!]p1x1...pkxkn!
x i x_i xi On the edge of ( Expectation and variance ):
E ( x i ) = n p i E(x_i) = np_i E(xi)=npi
V ( x i ) = n p i ( 1 − p i ) V(x_i) = np_i(1 - p_i) V(xi)=npi(1−pi)
Generate polynomial random variables
It is known that : Multiple display variables : ( x 1 , x 2 , . . . , x k ) (x_1, x_2, ...,x_k) (x1,x2,...,xk), Probability of occurrence : ( p 1 , P 2 , . . . p k ) (p_1, P_2, ...p_k) (p1,P2,...pk)
- i = 1 → k i = 1 \to k i=1→k
- p i ′ = p i / ∑ j = i k p j p_i' = p_i / \sum_{j=i}^k p_j pi′=pi/∑j=ikpj
- n i ′ = n − ∑ j = 1 i − 1 x j n_i' = n - \sum_{j=1}^{i-1} x_j ni′=n−∑j=1i−1xj
- Generate a random binomial variable : x i ∼ B i n o m i a l ( n i ′ , p i ′ ) x_i \sim Binomial(n_i', p_i') xi∼Binomial(ni′,pi′)
- ( x 1 , x 2 , . . . x k ) (x1, x_2, ... x_k) (x1,x2,...xk)
example : Suppose there are only three possible outcomes in an experiment , The probabilities are :0.5, 0.3, 0.2. Suppose you repeat five independent experiments , The number of times each situation occurs in this case , namely : Random polynomial variables : x 1 , x 2 , x 3 x_1, x_2, x_3 x1,x2,x3 How much could it be ?
- i = 1 , n 1 ′ = 5 , p 1 ′ = 0.5 , B i n o m i a l ( 5 , 0.5 ) = 2 , x 1 = 2 i = 1,n_1' = 5,p_1' = 0.5, Binomial(5, 0.5) = 2, x_1 = 2 i=1,n1′=5,p1′=0.5,Binomial(5,0.5)=2,x1=2
- i = 2 , n 2 ′ = 3 , p 2 ′ = 0.3 / ( 0.3 + 0.2 ) = 0.6 , B i n o m i a l ( 3 , 0.6 ) = 2 , x 2 = 2 i = 2, n_2' = 3,p_2' = 0.3/(0.3+0.2) = 0.6, Binomial(3, 0.6) = 2, x_2 = 2 i=2,n2′=3,p2′=0.3/(0.3+0.2)=0.6,Binomial(3,0.6)=2,x2=2
- i = 3 , n 3 ′ = 1 , p 3 ′ = 0.2 / 0.2 = 1.0 , B i n o m i a l ( 1 , 1.0 ) = 1 , x 3 = 1 i = 3, n_3' = 1, p_3' = 0.2/0.2 = 1.0, Binomial(1, 1.0) = 1, x_3 = 1 i=3,n3′=1,p3′=0.2/0.2=1.0,Binomial(1,1.0)=1,x3=1
- ( x 1 = 2 , x 2 = 2 , x 3 = 1 ) (x_1 = 2, x_2 = 2, x_3 = 1) (x1=2,x2=2,x3=1)
Simulation generates polynomial variables
import numpy as np
import matplotlib.pyplot as plt
def generateMultinomial(n = 100, k=3, probas=[0.5, 0.3, 0.2]):
x = [0, 0, 0]
for i in range(k):
p_ = probas[i]/np.sum(probas[i:])
n_ = n - np.sum(x[:i+1])
b = np.random.binomial(n_, p_)
x[i] = b
return x

边栏推荐
猜你喜欢

June 27 talk SofiE

Lumiprobe 脱氧核糖核酸丨磷酸盐 CPG 1000 固体载体

Lumiprobe deoxyribonucleic acid alkyne DT phosphimide

Hi, you have a code review strategy to check

信息学奥赛一本通2061:梯形面积

Differential equations of satellite motion

Intelligent diagnosis of Alzheimer's disease

重磅!2022最新SCI影响因子发布,三大名刊NCS及国内期刊TOP10排名有变化 (内附2022年最新影响因子)

Implementing redis distributed locks using custom annotations

Redis installation in windows and Linux Environment
随机推荐
技术沟通遇到3个为什么背后的逻辑
墨滴排版
EMC-浪涌防护及退耦设计
卫星运动的微分方程
Netease strict selection offline data warehouse quality construction practice
信息学奥赛一本通1002:输出第二个整数
MCS:离散随机变量——几何分布
Chinese garbled code output from idea output station
MCS:离散随机变量——Poisson分布
Lumiprobe 活性染料丨羧酸:Sulfo-Cyanine7.5羧酸
Evaluation index of high concurrency software (website, server interface)
Pytorch two-dimensional multi-channel convolution operation method
mysql 备份与还原
第九章 APP项目测试(4) 测试工具
SOFARegistry 源码|数据同步模块解析
I want to search the hundreds of nodes in the data warehouse. Can I check a table used in the SQL
Lumiprobe 活性染料丨环炔染料:AF488 DBCO,5 异构体
信息学奥赛一本通1194:移动路线
Analysis of constant current source circuit composed of two NPN tubes
Informatics Olympiad all in one 1003: aligned output