I have three vectors with sampled values, each from a specific probability distribution. (The vectors contain time series data of the growth rate of retail prices of specific goods)
%pearsrnd(mu,sigma,skew,kurt,m,n)
commodity1=pearsrnd(0.005,0.085,0.237,7.899,1,600);
commodity2=pearsrnd(0.003,0.040,0.280,5.630,1,600);
commodity3=pearsrnd(0.006,0.139,-0.207,4.209,1,600);
However, I want to add two correlation to the data. Specifically, the correlation between commodity1
and commodity3
should be 0.135, the correlation between commodity2
and commodity3
should be 0.115. How can I solve this most easily?