statwiki talk:Community portal: Difference between revisions
Jump to navigation
Jump to search
(Created page with "June 4 Lecture <br />Random Vector Generation <br />We want to sample from X=(X<sub>1</sub>,X<sub>2</sub>,...,X<sub>d</sub>),a d-dimensional vector. Case 1: <br />If X<sub>1</su...") |
(No difference)
|
Latest revision as of 23:26, 4 June 2013
June 4 Lecture
Random Vector Generation
We want to sample from X=(X1,X2,...,Xd),a d-dimensional vector.
Case 1:
If X1, X2, ..., Xd are all independent, then
we can sample from eachcomponent X1, X2,..., Xd individually and then form a vector.
Since f(x)= f(x1, x2, ..., xd)= f(x1)*f(x2)*...*f(xd).
Case 2:
If X1, X2, ..., Xd are not independent, then
we need to know the conditional distribution of f(x2|x1), f(x3|x2,x1),...,
f(xd|x(d-1),...,x1).
Since f(x)= f(x2|x1)*f(x3|x2,x1)*...*
f(xd|x(d-1),...,x1).
Example:generate Uniform random vector
X= (x1,..., sd) from the d-dimensional rectangle
D= {(x1,..., sd): ai <= bi, i= 1,..., d}
Code:
for i= 1,..., d Ui~U(0, 1) Xi= ai + U(bi-ai) end X=(x1,..., xd)