|
This is a common task in simulating the
end-point of financial derivatives.
Assume that you know the distribution
of each component of A, call it Phi ( assume that the distribution all
components is the same.)
If you want each component of B to be
correlated with its corresponding component of A with a linear correlation
coefficient of d, then apply the usual correlation transform to each
component, then for each sample of component i:
1) pick a random sample from
Phi, z; i.e. z = Phi^(-1)(u)
where u is a uniform
random variate on 0,1;
2) let v =: d*a(i) +
z*sqrt(1-d^2);
3) assuming that you want your random
variate b(i) to be
on the
interval 0,1, then transform v back with
b(i) =
Phi(v).
This results for every component i, in
a random vector b(i) that is also distributed by Phi and that is correlated
with the i th component of a with a linear correlation coefficient
d.
Paul H. Lasky
P & B Consultants
Hi folks,
Suppose i have a random vector A of size n.
I want to generate a vector B such that correlation
between A and B is (exactly) a constant, ie. corr( A, B ) = d, where d is
given number.
This is not a statistic question. I'm not trying to
find the joint distribution where rho equals d so that i can generate
random samples out of it. And surely that can be done with
rmvnorm(mu, rho). Rather, it is a simulation question. I want to
find the set F such that for every U in F,
corr(U, A) = d
Thank everyone. I'm using SPlus 6.1 rel 1.
Horace W. Tso
Portland General Electric
Portland, Oregon USA
503-464-8430
|