statwiki talk:Community portal
Jump to navigation
Jump to search
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)