copulaCdfGaussian
First introduced in version: 3.00.6
Syntax
copulaCdfGaussian(rho, X)
Details
Calculates the cumulative probability of the Gaussian copula, with linear correlation parameters rho evaluated at the points in X.
Parameters
rho is a scalar or matrix that specifies the linear correlation parameters.
-
When X is two-dimensional data, rho can be a DOUBLE scalar that specifies the correlation coefficient between the two variables. The value must be in the range
(-1, 1). -
rho can also be a 2×2 correlation matrix.
X is a non-empty two-dimensional numeric matrix or table with dimensions n×p (only p = 2 is currently supported), specifying the set of evaluation points for which densities are computed. Here, n is the number of evaluation points, that is, the number of rows in X; p is the number of variables, that is, the number of columns in X.
-
All elements must be finite numbers.
-
Rows whose elements are all in the open interval
(0, 1)are evaluated using the Gaussian copula cumulative distribution formula. -
Rows with any element
u <= 0return 0. Rows with all elementsu >= 1return 1. -
When X is a table, each column represents a variable, and the column order defines the variable order.
Returns
A DOUBLE vector with the same length as the number of rows in X. The i-th element of the returned vector is the copula cumulative probability for the i-th row of X.
Examples
Example 1. Calculate the cumulative probability of a two-dimensional Gaussian copula
with correlation coefficient 0.5 at the central point [0.5,
0.5].
X = matrix([0.5], [0.5])
y = copulaCdfGaussian(0.5, X)
y
// Output: [0.3333333334083112]
Example 2. Evaluate multiple sets of two-dimensional pseudo-observations and demonstrate how boundary points are handled.
u1 = [0.0, 0.2, 1.0]
u2 = [0.1, 0.3, 1.0]
X = matrix(u1, u2)
y = copulaCdfGaussian(0.7, X)
y
// Output: [0, 0.1433145419221347, 1]
Example 3. Use a fitted correlation matrix to calculate Gaussian copula cumulative probability for sample points.
n = 1000
x1 = norm(0, 1, n)
x2 = 0.7 * x1 + sqrt(1 - 0.49) * norm(0, 1, n)
u1 = (rank(x1) + 1) \ (n + 1.0)
u2 = (rank(x2) + 1) \ (n + 1.0)
X = matrix(u1, u2)
fitRes = copulaFitGaussian(X)
y = copulaCdfGaussian(fitRes.rho, X)
avg(y)
// Output: 0.3757154812666682
Example 4. Use a table as input to calculate the cumulative probability of pseudo-observations for two stocks under the specified Gaussian copula parameters.
n = 1000
retA = norm(0.0005, 0.02, n)
retB = 0.6 * retA + sqrt(1 - 0.36) * norm(0.0003, 0.015, n)
uA = (rank(retA) + 1) \ (n + 1.0)
uB = (rank(retB) + 1) \ (n + 1.0)
stockReturns = table(uA as stockA, uB as stockB)
y = copulaCdfGaussian(0.6, stockReturns)
y[0:5]
// Output: [0.887594899922026,0.840758480743543,0.331614007436525,0.452333747243809,0.446404642130547]
Related Functions: copulaFitGaussian, copulaRandGaussian, copulaCdfGaussian, copulaCdfStudent, copulaCdfClayton, copulaCdfFrank, copulaCdfGumbel
