使用Kendall的双变量高斯copula从β分布中生成与随机数据相关的随机数据taurank correlation equal to -0.5.
计算线性些小n parameter from the rank correlation value.
Use a Gaussian copula to generate a two-column matrix of dependent random values.
Each column contains 100 random values between 0 and 1, inclusive, sampled from a continuous uniform distribution.
Create ascatterhist
plot to visualize the random numbers generated using the copula.
直方图表明,副群的每一列中的数据具有边缘均匀分布。散点图显示两列中的数据是负相关的。
Use the inverse cdf functionbetainv
to transform each column of the uniform marginal distributions into random numbers from a beta distribution. In the first column, the first shape parameterAis equal to 1, and a second shape parameterB等于2。In the second column, the first shape parameterA等于1.5,第二个形状参数B等于2。
Create ascatterhist
图可视化相关的beta分布数据。
直方图显示了每个变量的边缘β分布。散点图显示负相关。
Verify that the sample has a rank correlation approximately equal to the initial value for Kendall'stau.
tau_sample =2×21.0000 -0.5135 -0.5135 1.0000
The sample rank correlation of -0.5135 is approximately equal to the -0.5 initial value fortau.