Learn R Programming

GRIDCOPULA (version 1.0.1)

d.grid: Evaluates the density of a grid type copula

Description

Returns the corresponding density values of a grid type copula.

Usage

d.grid(U, V = NULL, gc)

Value

Returns a vector with the corresponding density.

Arguments

U

a matrix of size \(nx2\) with the observed values. It can also be a vector of size \(kx1\) with the values of the \(U_1\) variable.

V

optional, a vector of size \(kx1\) with the values of the \(U_2\) variable.

gc

a grid type copula object.

Examples

Run this code
# Generating simulated data with a transformation to the copula domain
n <- 500
x <- rgamma(n,4,1/2)
e <- rnorm(n,0,.3)
y <- sin(x+e)
Fx <- ecdf(x)
Fy <- ecdf(y)
u <- Fx(x)
v <- Fy(y)
df <- cbind(u,v)
copula.grid <- estimate.gridCopula(U = df, k = 5, m = 4 , method = "ml")
d.grid(df,gc=copula.grid)

# Using the Iris dataset, transformation is not mandatory
copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml")
d.grid(copula.grid$U,gc=copula.grid)

Run the code above in your browser using DataLab