当前位置:网站首页>MCS: discrete random variable

MCS: discrete random variable

2022-06-23 05:22:00 Fight the tiger tonight

Discrete Arbitrary

x x x Is a discrete variable , It represents a set of values , x i x_i xi For the th in the set i i i Number ,( i ∼ 1 → N i \sim 1 \to N i1N), A specific value in a collection x i x_i xi The probability of is written as : P ( x i ) = P ( x = x i ) P(x_i) = P(x = x_i) P(xi)=P(x=xi), therefore P ( x 1 ) , . . . P ( x N ) P(x_1), ... P(x_N) P(x1),...P(xN) Defined variables x x x Probability distribution of .

∑ i P ( x i ) = 1 \sum_i P(x_i) = 1 iP(xi)=1

Variable x x x Expectation and variance of :

E ( x ) = ∑ i x i P ( x i ) E(x) = \sum_i x_i P(x_i) E(x)=ixiP(xi)

V ( x ) = E ( x 2 ) − E ( x ) 2 V(x) = E(x^2) - E(x)^2 V(x)=E(x2)E(x)2

E ( x 2 ) = ∑ i x i 2 P ( x i ) E(x^2) = \sum_i x_i^2 P(x_i) E(x2)=ixi2P(xi)

CDF:

F ( x i ) = P ( x < = x i ) F(x_i) = P(x <= x_i) F(xi)=P(x<=xi)

Generate random variables that obey any probability distribution

  1. For each x i x_i xi, find F ( x i ) , i ∼ 1 → N F(x_i), i \sim 1 \to N F(xi),i1N
  2. Generate a random continuous uniform u ∼ U ( 0 , 1 ) u \sim U(0, 1) uU(0,1)
  3. Locate the smallest x i x_i xi where u < F ( x i ) u < F(x_i) u<F(xi)
  4. $ x = x_i$
  5. Return x x x

example : hypothesis x x x Is discrete , Obey the following probability distribution and cumulative distribution function :

xP(x)F(x)
00.40.4
10.30.7
20.20.9
30.11.0
  1. Generate a uniformly distributed random variable : u ∼ U ( 0 , 1 ) , u = 0.58 u \sim U(0, 1), u = 0.58 uU(0,1),u=0.58
  2. u < F ( 1 ) = 0.7 u < F(1) = 0.7 u<F(1)=0.7
  3. x = 1 x = 1 x=1
原网站

版权声明
本文为[Fight the tiger tonight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230317071432.html