How to Generate a random variable with a defined correlation to an existing variable?

2 ビュー (過去 30 日間)
magdy shaaban
magdy shaaban 2017 年 2 月 2 日
回答済み: Niels 2017 年 2 月 2 日
for example if I have a fixed vector x1=[0.5;0.2;0.6;0.30;0.7]; how can I generate a vector x2 with a predefined correlation say 0.7 with x1?

回答 (1 件)

Niels
Niels 2017 年 2 月 2 日
>> x1=[0.5;0.2;0.6;0.30;0.7]
x1 =
0.5000
0.2000
0.6000
0.3000
0.7000
>> x2=0.7*x1
x2 =
0.3500
0.1400
0.4200
0.2100
0.4900

カテゴリ

Help Center および File ExchangeCode Generation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by