Académique Documents
Professionnel Documents
Culture Documents
1 Lois discrètes
∀x ∈ {0, 1} , P (X = x) = θx (1 − θ)1−x
E[X] = θ V ar[X] = θ (1 − θ)
E[X] = n θ V ar[X] = n θ (1 − θ)
Exemple
On considère une urne contenant N boules, N1 boule rouges, N2 = N −N1 boules
noires. On en tire par hasard n boules avec remise . Soit X la variable aléatoire
N1
égale au nombre de boules rouges tirées. Posons p = , on a :
N
P (X = k) = Cnk pk (1 − p)n−k , ∀k ∈ {0, 1, . . . , n}.
Propriétés
➊.➋.➊. Si X suit une loi Bin(n, θ), alors n − X suit une loi Bin(n, 1 − θ).
➊.➋.➋. Si X1 , . . . , Xn sont des variables aléatoires indépendantes suivant la même
loi Ber(θ), alors Sn = X1 + . . . + Xn suit une loi Bin(n, θ).
K D.GHORBANZADEH
2/25 Simulation des lois usuelles avec Matlab
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 n=20;
5 theta=0.2;
6 nb=2000;
7 R=binornd(n,theta,nb,1);
8 hist(R)
9 x=0:1:max(R);
10 p1=nb*binopdf(x,n,theta);
11 hold on
12 plot(x,p1,’*k’,’linewidth’,1);
13 box off
14 hold off
rhbino.m
450
400
350
© D.Ghorbanzadeh (1997)
300
250
200
150
100
50
0
0 1 2 3 4 5 6 7 8 9 10
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 3/25
∀k ∈ N⋆ , P (X = x) = θ (1 − θ)k−1
1 1−θ
E[X] = V ar[X] =
θ θ2
θt
fonction génératrice GX (t) = E[tX ] = .
1 − (1 − θ)t
◮ Remarque
Dans certains ouvrages la loi Géo(θ) est présentée sous la forme :
∀k ∈ N , P (X = x) = θ (1 − θ)k .
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 theta=.13;
5 nb=500;
6 R = geornd(theta,nb,1);
7 hist(R)
8 x=0:1:max(R);
9 p1=2*nb*geopdf(x,theta);
10 hold on
11 plot(x,p1,’*k’);
12 box off
13 hold off
rhgeo.m
K D.GHORBANZADEH
4/25 Simulation des lois usuelles avec Matlab
250
200
150
© D.Ghorbanzadeh (1997)
100
50
0
0 5 10 15 20 25 30 35 40 45
∀n ∈ N⋆ , ∀k ∈ N , P (X = k) = Cn+k−1
k
θn (1 − θ)k
n n (1 − θ)
E[X] = V ar[X] =
θ θ2
n
X θt
fonction génératrice GX (t) = E[t ] = .
1 − (1 − θ)t
Propriété
Si X1 , . . . , Xn sont des variables aléatoires indépendantes suivant la même loi
Géo(θ), alors Sn = X1 + . . . + Xn suit une loi BN (n, θ).
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 5/25
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 theta=.3;
5 N=5;
6 nb=500;
7 R = nbinrnd(N,theta,nb,1);
8 hist(R)
9 x=0:1:max(R);
10 p1=3.2*nb*nbinpdf(x,N,theta);
11 hold on
12 plot(x,p1,’*k’);
13 box off
14 hold off
rhbineg.m
140
120
100
© D.Ghorbanzadeh (1997)
80
60
40
20
0
0 5 10 15 20 25 30 35 40 45
K D.GHORBANZADEH
6/25 Simulation des lois usuelles avec Matlab
λk
∀k ∈ N , P (X = k) = e−λ
k!
E[X] = λ V ar[X] = λ
Propriété
Si X1 , . . . , Xn sont des variables aléatoires indépendantes de lois respectives :
n
X
P(λ1 ), . . . , P(λn ), alors Sn = X1 + . . . + Xn suit une loi P( λk ).
k=1
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 lambda=7;
5 nb=1000;
6 R = poissrnd(lambda,nb,1);
7 hist(R)
8 x=0:1:max(R)+1;
9 p1=1.7*nb*poisspdf(x,lambda);
10 hold on
11 plot(x,p1,’*k’,’linewidth’,1);
12 box off
13 hold off
rhpois.m
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 7/25
350
300
250
200
© D.Ghorbanzadeh (1997)
150
100
50
0
0 2 4 6 8 10 12 14 16 18
1
∀k ∈ {1, . . . , N} , P (X = k) =
N
N +1 N2 − 1
E[X] = V ar[X] = .
2 12
P (X = x0 ) = 1
E[X] = x0 V ar[X] = 0
K D.GHORBANZADEH
8/25 Simulation des lois usuelles avec Matlab
2 Lois continues
2.1 Loi Uniforme sur l’intervalle [a, b], notée U ([a, b])
1
densité fX (x) = 1l[a,b] (x)
b−a
si x ≤ 0
0
x−a
fonction de répartition FX (x) = si a < x < b
b−a
1 si x ≥ b
a+b (b − a)2
E[X] = V ar[X] =
2 12
ei bt − ei at
fonction caractéristique ϕX (t) = E[ei tX ] = .
i t(b − a)
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 a=2;
5 b=7;
6 nb=1000;
7 R = unifrnd(a,b,nb,1);
8 hist(R)
9 x = a:0.1:b;
10 p1=.55*nb*unifpdf(x,a,b);
11 hold on
12 plot(x,p1,’k’,’linewidth’,2);
13 box off
14 hold off
rhunif.m
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 9/25
120
100
80
© D.Ghorbanzadeh (1997)
60
40
20
0
2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7
2.2 Loi Triangulaire sur l’intervalle [−a, a], notée ∆([−a, a])
1 |x|
densité fX (x) = (1 − ) 1l[−a,a] (x)
a a
0 si x ≤ −a
(x + a)2
si − a ≤ x ≤ 0
2a2
fonction de répartition FX (x) =
(a − x)2
1 − si 0 ≤ x < a
2a2
1 si x ≥ a
a2
E[X] = 0 V ar[X] =
6
at 2
sin
fonction caractéristique ϕX (t) = E[ei tX ] =
2.
at
2
K D.GHORBANZADEH
10/25 Simulation des lois usuelles avec Matlab
Propriété
Si X et Y sont deux variables aléatoires indépendantes suivant la même loi U([0, a]),
alors X − Y suit une loi ∆([−a, a]).
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 a=3; nb=1000;
5 X = unifrnd(0,a,nb,1); %loi uniforme
6 Y = unifrnd(0,a,nb,1); %loi uniforme
7 hist(X-Y)
8 x = -1-a:0.1:a+1;
9 p1=.55*nb*(1/a)*(1-abs(x)./a).*(x>=-a & x<=a);
10 hold on
11 plot(x,p1,’k’,’linewidth’,2);
12 box off
13 hold off
rhtriag.m
200
180
160
140
© D.Ghorbanzadeh (1997)
120
100
80
60
40
20
0
−4 −3 −2 −1 0 1 2 3 4
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 11/25
(x − m)2
1 −
densité fX (x) = √ e 2σ 2
σ 2π
E[X] = m V ar[X] = σ 2
1 22
fonction caractéristique ϕX (t) = E[ei tX ] = exp(i mt − σ t)
2
1 22
transformée de Laplace ϕX (t) = E[etX ] = exp(mt + σ t ).
2
Propriétés
➋.➌.➊. La densité et la fonction de répartition de la loi N (0, 1) sont notées par :
x2 x
1
Z
−
ϕ(x) = √ e 2 Φ(x) = ϕ(t) dt.
2π −∞
K D.GHORBANZADEH
12/25 Simulation des lois usuelles avec Matlab
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 m=7;
5 sigma2=13;
6 nb=2000;
7 R= normrnd(m,sqrt(sigma2),nb,1);
8 hist(R)
9 x=m-4*sqrt(sigma2):0.01:m+4*sqrt(sigma2);
10 p1=2*nb*normpdf(x,m,sqrt(sigma2));
11 hold on
12 plot(x,p1,’k’,’linewidth’,2);
13 box off
14 hold off
rhnormal.m
500
450
400
350
© D.Ghorbanzadeh (1997)
300
250
200
150
100
50
0
−10 −5 0 5 10 15 20 25
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 13/25
1 1
E[X] = V ar[X] =
λ λ2
1
fonction caractéristique ϕX (t) = E[ei tX ] = .
it
1−
λ
Propriété
1 X −a
Si X est une variable aléatoire de loi U(]a, b[), alors les variables aléatoires − log
λ b−a
1 b−X
et − log suivent la même loi Exp(λ).
λ b−a
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 lambda=1/4;
5 nb=1000;
6 R = exprnd(lambda,nb,1);
7 hist(R)
8 x=min(R):0.01:max(R);
9 p1=130*exppdf(x,lambda);
10 hold on
11 plot(x,p1,’k’,’linewidth’,2);
12 box off
13 hold off
rhexp.m
K D.GHORBANZADEH
14/25 Simulation des lois usuelles avec Matlab
600
500
400
© D.Ghorbanzadeh (1997)
300
200
100
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
ba a−1 −b x
densité fX (x) = x e 1l]0,∞[ (x)
Γ(a)
Γ(a + k) a a
∀k ∈ N E[X k ] = , E[X] = V ar[X] =
bk Γ(a) b b2
1
fonction caractéristique ϕX (t) = E[ei tX ] = a .
it
1−
b
Propriétés
➋.➎.➊. Exp(λ) ≡ γ(1, λ).
b
➋.➎.➋. Si X suit une loi γ(a, b), alors ∀α > 0 , αX suit une loi γ(a, ).
α
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 15/25
1
➋.➎.➌. Si X suit une loi γ(a, b), alors la densité de la loi de est définie par :
X
b
−
a
b e x
f 1 (x) = 1l]0,∞[ (x).
X Γ(a) xa+1
➋.➎.➍. Si X suit une loi γ(a, b), alors pour a > 2 on a :
1 b 1 b2
E[ ]= V ar[ ]= .
X a−1 X (a − 1)2 (a − 2)
1
➋.➎.➎. Si X suit une loi γ(a, b), alors pour α > 0, la densité de la loi de X α est
définie par :
α ba α a−1 −b xα
fX α1 (x) = x e 1l]0,∞[ (x).
Γ(a)
➋.➎.➏. Si X1 , . . . , Xn sont des variables aléatoires indépendantes de lois respec-
n
X
tives : γ(a1 , b), . . . , γ(an , b), alors Sn = X1 + . . . + Xn suit une loi γ( ak , b).
k=1
➋.➎.➐. Si X1 , . . . , Xn sont des variables aléatoires indépendantes suivant la même
n
1 X
loi Exp(λ), alors Xk suit une loi γ(n, n λ).
n k=1
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 a=3;
5 b=1/2;
6 nb=1000;
7 R = gamrnd(a,b,nb,1);
8 hist(R)
9 x=0.00001:0.01:max(R);
10 p1=(nb/2)*gampdf(x,a,b);
11 hold on
12 plot(x,p1,’k’,’linewidth’,2);
13 box off
14 hold off
rhgamma.m
K D.GHORBANZADEH
16/25 Simulation des lois usuelles avec Matlab
350
300
250
© D.Ghorbanzadeh (1997)
200
150
100
50
0
0 1 2 3 4 5 6 7
1
densité fX (x) = xa−1 (1 − x)b−1 1l]0,1[ (x)
β(a, b)
où β(a, b) désigne la fonction Beta définie par :
Z 1
Γ(a) Γ(b)
β(a, b) = β(b, a) = xa−1 (1 − x)b−1 dx = .
0 Γ(a + b)
Γ(a + b) Γ(a + k)
∀k ∈ N E[X k ] =
Γ(a) Γ(a + b + k)
a ab
E[X] = V ar[X] = .
a+b (a + b + 1) (a + b)2
Propriétés
➋.➏.➊. Soit Fa,b la fonction de répartition de la loi βeta(a, b) et Fa,b
−1
la fonction
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 17/25
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 a=4; b=3;
5 nb=1200;
6 R = betarnd(a,b,nb,1);
7 hist(R)
8 x=0:0.01:1;
9 p1=100*betapdf(x,a,b);
10 hold on
11 plot(x,p1,’k’,’linewidth’,2);
12 box off
13 hold off
rhbeta.m
1 xa−1
densité fX (x) = 1l]0,∞[ (x)
β(a, b) (1 + x)a+b
Γ(a + k) Γ(b − k)
∀k < b E[X k ] =
Γ(a) Γ(b)
a a (a + b − 1)
E[X] = V ar[X] = .
b−1 (b − 2) (b − 1)2
Propriétés
K D.GHORBANZADEH
18/25 Simulation des lois usuelles avec Matlab
250
200
© D.Ghorbanzadeh (1997)
150
100
50
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
∀x ∈]0, ∞[ , Fa,b (x) = 1 − Fb,a ( )
x
−1 1
∀α ∈]0, 1[ , Fa,b (α) = −1 .
Fb,a (1 − α)
X
➋.➐.➋. Si X suit une loi βeta(a, b), alors suit une loi βII (a, b).
1−X
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 19/25
x
1 m/2−1
−
densité fX (x) = m/2 m x e 2 1l]0,∞[ (x)
2 Γ( 2 )
k
Γ( m2 + k)
k
∀k ∈ N E[X ] = 2
Γ( m2 )
E[X] = m V ar[X] = 2 m.
K D.GHORBANZADEH
20/25 Simulation des lois usuelles avec Matlab
Propriétés
➋.➑.➊. Si X1 , . . . , Xn sont des variables aléatoires indépendantes de lois respec-
n
X
tives : χ2m1 , . . . , χ2mn , alors Sn = X1 + . . .+ Xn suit une loi χ2m avec m = mk .
k=1
➋.➑.➋. Si X1 , . . . , Xn sont des variables aléatoires indépendantes de lois respec-
n 2
X Xk − µ k
tives : N (µ1, σ12 ), . . . , N (µn , σn2 ), alors suit une loi χ2n .
k=1
σk
➋.➑.➌. Si X1 , . . . , Xn sont des variables aléatoires indépendantes suivant la même
n 2 n
2
X Xk − X n 1 X
loi N (µ, σ ), alors suit une loi χ2n−1 où X n = Xk .
k=1
σ n k=1
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 m=6;
5 nb=1000;
6 R = chi2rnd(m,nb,1);
7 hist(R)
8 x=0.0001:0.01:max(R);
9 p1=2*nb*chi2pdf(x,m);
10 hold on
11 plot(x,p1,’k’,’linewidth’,2);
12 box off
13 hold off
rhchi2.m
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 21/25
350
300
250
© D.Ghorbanzadeh (1997)
200
150
100
50
0
0 5 10 15 20 25 30
− m+1
x2
1 2
densité fX (x) = √ 1+
m β( m2 , 21 ) m
m
E[X] = 0 ∀m > 2 , V ar[X] = .
m−2
Propriétés
➋.➒.➊. Si X et Y sont des variables aléatoires indépendantes de loi respectives :
X
N (0, 1) et χ2m , alors p suit une loi Tm .
Y /m
➋.➒.➋. Si X1 , . . . , Xn sont des variables aléatoires indépendantes suivant la même
√ n n
2 n (X n − µ) 1 X 1 X
loi N (µ, σ ), alors suit une loi Tn−1 où X n = Xk et Sn2 = (Xk − X n )2 .
Sn n n−1
k=1 k=1
K D.GHORBANZADEH
22/25 Simulation des lois usuelles avec Matlab
1 clear all
2 map(1,:) = [rand rand rand];
3 colormap(map)
4 m=19;
5 nb=1700;
6 R = trnd(m,nb,1);
7 hist(R)
8 x=-1+min(R):0.01:max(R)+1;
9 p1=.7*nb*tpdf(x,m);
10 hold on
11 plot(x,p1,’k’,’linewidth’,2);
12 box off
13 hold off
rhstud.m
500
450
400
350
© D.Ghorbanzadeh (1997)
300
250
200
150
100
50
0
−6 −4 −2 0 2 4 6
F IG . 12 – simulation de la loi Tm
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 23/25
m m2
n
m − m+n
2 m
densité fX (x) = 1+ x x 2 −1 1l]0,∞ (x)
β( m2 , n2 ) n
n
si n > 2 : E[X] =
n−2
2n2 (m + n − 2)
si n > 4 : V ar[X] = .
m(n − 4)(n − 2)2
Propriétés
➋.➓.➊. Soit Fm,n la fonction de répartition de la loi Fm,n et Fm,n −1
la fonction
réciproque de Fm,n . Alors, elles vérifient les relations suivantes :
1
∀x ∈]0, ∞[ , Fm,n (x) = 1 − Fn,m ( )
x
−1 1
∀α ∈]0, 1[ , Fm,n (α) = .
Fn,m
−1 (1 − α)
1
➋.➓.➋. Si X suit une loi Fm,n , alors suit une Fn,m .
X
➋.➓.➌. Si X suit une loi Tm , alors X 2 suit une F1,m .
➋.➓.➍. Si X et Y sont des variables aléatoires indépendantes de lois respectives :
X/m
χ2m et χ2n , alors suit une loi Fm,n .
Y /n
b
➋.➓.➎. Si X suit une loi βII (a, b), alors X suit une F2a,2b .
a
K D.GHORBANZADEH
24/25 Simulation des lois usuelles avec Matlab
K D.GHORBANZADEH
Simulation des lois usuelles avec Matlab 25/25
Lois Discrètes
Lois Continues
K D.GHORBANZADEH