主要内容

copulaparam

Copula parameters as function of rank correlation

描述

example

rho= copulaparam('高斯',r)返回线性相关参数,rho, that correspond to a Gaussian copula with Kendall’s rank correlation,r.

rho= copulaparam('t',r,nu)返回线性相关参数,rho, that correspond to at与肯德尔的等级相关性的copula,r, and degrees of freedom,nu.

alpha= copulaparam(family,r)返回copula参数,alpha, that corresponds to a bivariate Archimedean copula of the type specified byfamily, with Kendall’s rank correlation,r.

___= copulaparam(___,Name,Value)returns the correlation parameter using any of the previous syntaxes, with additional options specified by one or moreName,Valuepair arguments. For example, you can specify whether the input rank correlation value is Spearman’srhoor Kendall’stau.

例子

全部收缩

使用Kendall的双变量高斯copula从β分布中生成与随机数据相关的随机数据taurank correlation equal to -0.5.

计算线性些小n parameter from the rank correlation value.

RNGdefault%可再现性tau = -0.5;rho = copulaparam(“高斯”,tau)
Rho = -0.7071

Use a Gaussian copula to generate a two-column matrix of dependent random values.

u = copularnd('gaussian',Rho,100);

Each column contains 100 random values between 0 and 1, inclusive, sampled from a continuous uniform distribution.

Create ascatterhistplot to visualize the random numbers generated using the copula.

figure scatterhist(u(:,1),u(:,2))

直方图表明,副群的每一列中的数据具有边缘均匀分布。散点图显示两列中的数据是负相关的。

Use the inverse cdf functionbetainvto 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。

b = [betainv(u(::,1),1,2),betainv(u(::,2),1.5,2)];

Create ascatterhist图可视化相关的beta分布数据。

图散射史(b(::,1),b(:,2))

直方图显示了每个变量的边缘β分布。散点图显示负相关。

Verify that the sample has a rank correlation approximately equal to the initial value for Kendall'stau.

tau_sample = corr(b,'类型',“肯德尔”)
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.

Input Arguments

全部收缩

copula等级相关, returned as a scalar value or matrix of scalar values.

  • 如果ris a scalar correlation coefficient, thenrhois a scalar correlation coefficient corresponding to a bivariate copula.

  • 如果ris ap-经过-pcorrelation matrix, thenrhois ap-经过-pcorrelation matrix.

如果the copula is specified as one of the bivariate Archimedean copula types (“克莱顿”,'坦率', or'Gumbel'), thenr是标量值。

Degrees of freedom for thetCopula,指定为正整数值。

Data Types:single|双倍的

双变量Archimedean Copula家族, specified as one of the following.

“克莱顿” 克莱顿·科普拉(Clayton Copula)
'坦率' 弗兰克·帕科拉(Frank Copula)
'Gumbel' Gumbel copula

名称值对参数

Specify optional comma-separated pairs ofName,Value参数。Nameis the argument name and价值是相应的值。Name必须出现在引号中。您可以按任何顺序指定几个名称和值对参数NAME1,Value1,...,Namen,Valuen.

例子:“类型”,“ Spearman”计算Spearman的等级相关性。

Type of rank correlation, specified as the comma-separated pair consisting of'类型'and one of the following.

  • “肯德尔”- 指示的输入值ris a Kendall’staucorrelation value

  • 'Spearman'- 指示的输入值ris a Spearman’srho等级相关值

copulaparamuses an approximation to Spearman’s rank correlation for copula families that do not have an existing analytic formula. The approximation is based on a smooth fit to values computed at discrete values of the copula parameters. For atcopula, the approximation is accurate for degrees of freedom larger than 0.05.

例子:“类型”,“ Spearman”

Output Arguments

全部收缩

Linear correlation parameter, returned as a scalar value or matrix of scalar values.

  • 如果ris a scalar correlation coefficient, thenrhois a scalar correlation coefficient corresponding to a bivariate copula.

  • 如果ris ap-经过-pcorrelation matrix, thenrhois ap-经过-pcorrelation matrix.

Bivariate Archimedean copula parameter, returned as a scalar value. Permitted values foralphadepend on the specified copula family.

Copula Family Permitted Alpha Values
“克莱顿” [0,∞)
'坦率' (-∞,∞)
'Gumbel' [1,∞)

Data Types:single|双倍的

Introduced in R2006a