• Nie Znaleziono Wyników

2. Generation of random numbers (rejection method)

N/A
N/A
Protected

Academic year: 2021

Share "2. Generation of random numbers (rejection method)"

Copied!
1
0
0

Pełen tekst

(1)

Urszula Libal Modelling and Identication 2.1

2. Generation of random numbers (rejection method)

Task 1. /5 points/ Apply rejection method to generate random numbers with p.d.f. f() using supporting p.d.f. g() and constant c:

No Distribution names p.d.f. f(x) p.d.f. g(x) c

f -normal N(0,1)

f (x) = 1

2π exp 

x 2

2



g(x) = 1 2 exp (−|x|) c = q

2e

1 g -Laplace π

f -Beta(2,1)

f (x) = Γ(2)Γ(1) Γ(2+1) x 1 (1 − x) 0 1 {0 6 x 6 1} g(x) = 1 {0 6 x 6 1} c = 2 2 g -uniform U[0,1]

f -Beta(3,2)

f (x) = Γ(3)Γ(2) Γ(3+2) x 2 (1 − x) 1 1 {0 6 x 6 1} g(x) = 1 {0 6 x 6 1} c = 16 9 3 g -uniform U[0,1]

f -Beta(3/2,3/2)

f (x) = Γ(3/2)Γ(3/2) Γ(3) x

12

(1 − x)

12

1 {0 6 x 6 1} g(x) = 1 {0 6 x 6 1} c = Γ(3/2) 1

2

= π 4 4 g -uniform U[0,1]

f -triangular

f (x) = 2(1 − x)1 {0 6 x 6 1} g(x) = 1 {0 6 x 6 1} c = 2 5 g -uniform U[0,1]

Rejection method:

1. Generate u ∼ U[0, 1].

2. Generate x having the p.d.f. g(x).

3. Create the pairs (x, y) = (x, cg(x)u) for c = max f (x) g(x) .

4. Reject the pairs (x, y) that do not fulll the condition cg(x)u 6 f(x).

Plot histograms for generated data. Plot theoretical probability density functions - see pdf function in MATLAB.

/Total: 5 points/

Cytaty

Powiązane dokumenty

deterministic random bit generators (NRBGs) produce bits non-deterministically using some physical source that produces some sort of random output... Some NIST

Tablice wartości oczekiwanych i dyspersji liczby ogniw w sekwencjach losowych z podaniem prawdopodobieństw przekroczenia

In papers devoted to the necessary and sufficient conditions for SLLN some authors give such conditions for certain classes of random variables, expressing them in terms of

Section 4 presents the general formula (26) (known formula) giving the decomposition of the Stirling numbers of second kind in the linear combination of binomial coefficients by using

For this reason, if u and v are two leaves adjacent to different support vertices in T , then u and v cannot be 2-distance dominated by the same element of D.. This implies that |D|

a) Czy zaprezentowane w trakcie laboratorium metody faktycznie mogą stanowić samodzielne sposoby kompozycji, czy służyć za źródło inspiracji dla kompozytora? Odpowiedź uzasadnij.

TK wskazał: „Wymóg efek- tywności kontroli rozstrzygnięć zapadłych w danej sprawie należy rozpatry- wać w perspektywie konstytucyjnych gwarancji prawa do sądu (art. Co prawda