Title: | Bivariate Copula Functions Based on Regular Grid |
---|---|
Description: | Estimates grid type bivariate copula functions, calculates some association measures and provides several copula graphics. |
Authors: | Rogelio Salinas Gutiérrez [aut, cre, cph] , Angélica Hernández Quintero [aut, cph] , Pedro Abraham Montoya Calzada [aut, cph] |
Maintainer: | Rogelio Salinas Gutiérrez <[email protected]> |
License: | GPL-3 |
Version: | 1.0.1 |
Built: | 2024-12-02 10:49:05 UTC |
Source: | CRAN |
This function receives a grid type copula as a parameter and returns the value of the AIC.
aic.grid(gc)
aic.grid(gc)
gc |
a grid type copula object. |
Returns a number with the AIC of a grid type copula.
# 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") aic.grid(copula.grid) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") aic.grid(copula.grid)
# 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") aic.grid(copula.grid) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") aic.grid(copula.grid)
This function receives a grid type copula as a parameter and returns the value of the BIC.
bic.grid(gc)
bic.grid(gc)
gc |
a grid type copula object. |
Returns a number with the BIC of a grid type copula.
# 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") bic.grid(copula.grid) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") bic.grid(copula.grid)
# 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") bic.grid(copula.grid) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") bic.grid(copula.grid)
Draws the density / distribution function of a grid copula with contours and colors
contour_grid(gc, FUN = "d.grid", color.name = "none", color.size = 7, show.points = FALSE, copula.domain = TRUE, normal.marginal = TRUE)
contour_grid(gc, FUN = "d.grid", color.name = "none", color.size = 7, show.points = FALSE, copula.domain = TRUE, normal.marginal = TRUE)
gc |
a grid type copula object. |
FUN |
the name of the function to be applied (d.grid for density, p.grid for distribution), default is 'd.grid'. |
color.name |
indicates the palette of colors |
color.size |
indicates the number of colors. |
show.points |
a logical value indicating if the data must be showed or not, default is FALSE. |
copula.domain |
Indicates whether it is going
to be graphed in the domain of the copulas |
normal.marginal |
Indicates whether the marginals should be taken as normal distributions. The default value is TRUE, otherwise the gaussian kernel is used as marginal distribution. This argument is neccesary only if the argument copula.domain is FALSE. |
Returns a graph of the density / distribution.
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") contour_grid(gc = copula.grid, FUN = 'd.grid', color.name = "rainbow") contour_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow") #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ls") contour_grid(gc = copula.grid, FUN = 'd.grid', color.name= "rainbow", color.size = 10, copula.domain=FALSE) contour_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow", color.size = 10, copula.domain=FALSE)
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") contour_grid(gc = copula.grid, FUN = 'd.grid', color.name = "rainbow") contour_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow") #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ls") contour_grid(gc = copula.grid, FUN = 'd.grid', color.name= "rainbow", color.size = 10, copula.domain=FALSE) contour_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow", color.size = 10, copula.domain=FALSE)
Draws the density / distribution function of a grid copula with contours and colors
contour_image_grid( gc, FUN = "p.grid", u1 = seq(0, 1, length.out = 100), u2 = seq(0, 1, length.out = 100), color.name = "heat.colors", color.size = 40 )
contour_image_grid( gc, FUN = "p.grid", u1 = seq(0, 1, length.out = 100), u2 = seq(0, 1, length.out = 100), color.name = "heat.colors", color.size = 40 )
gc |
a grid type copula object. |
FUN |
the name of the function to be applied (d.grid, p.grid), default is 'p.grid'. |
u1 |
indicates the place for lines on axis |
u2 |
indicates the place for lines on axis |
color.name |
indicates the palette of colors. |
color.size |
indicates the number of colors. |
Returns a graph of the density / distribution.
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ls") contour_image_grid(gc = copula.grid, FUN = 'd.grid', color.name= "rainbow", color.size = 10) contour_image_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow", color.size = 10) #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ls") contour_image_grid(gc = copula.grid, FUN = 'd.grid', color.name= "rainbow", color.size = 10) contour_image_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow", color.size = 10)
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ls") contour_image_grid(gc = copula.grid, FUN = 'd.grid', color.name= "rainbow", color.size = 10) contour_image_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow", color.size = 10) #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ls") contour_image_grid(gc = copula.grid, FUN = 'd.grid', color.name= "rainbow", color.size = 10) contour_image_grid(gc = copula.grid, FUN = 'p.grid', color.name = "rainbow", color.size = 10)
Returns the corresponding density values of a grid type copula.
d.grid(U, V = NULL, gc)
d.grid(U, V = NULL, gc)
U |
a matrix of size |
V |
optional, a vector of size |
gc |
a grid type copula object. |
Returns a vector with the corresponding density.
# 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)
# 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)
Draws the scatter plot of bivariate data in the unit square
data.grid(U, draw.lines = TRUE, k = 4, m = 4)
data.grid(U, draw.lines = TRUE, k = 4, m = 4)
U |
matrix of size |
draw.lines |
draws lines inside the unit square or not. |
k |
positive integer indicating the number of subintervals for the |
m |
positive integer indicating the number of subintervals for the |
Returns a scatter plot of bivariate data in the unit square.
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) k <- 10 m <- 10 data.grid(U=df, draw.lines = FALSE, k = k, m = m) data.grid(U=df, draw.lines = TRUE, k = k, m = m)
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) k <- 10 m <- 10 data.grid(U=df, draw.lines = FALSE, k = k, m = m) data.grid(U=df, draw.lines = TRUE, k = k, m = m)
This function estimates grid type copulas by one of the following methods: maximum likelihood or least squares (See reference).
estimate.gridCopula( X = NULL, U = NULL, k = NULL, m = NULL, method = "ml", D.ini = NULL, criterion = "AIC" )
estimate.gridCopula( X = NULL, U = NULL, k = NULL, m = NULL, method = "ml", D.ini = NULL, criterion = "AIC" )
X |
a matrix of size |
U |
a matrix of size |
k |
a positive integer indicating the number of subintervals for the |
m |
a positive integer indicating the number of subintervals for the |
method |
the selected method for estimation, can be least squares "ls" or maximum likelihood "ml". By default "ml". |
D.ini |
an optional matrix with initial density values for the estimation through maximum likelihood. |
criterion |
If the values of k and m are not specified, they will be obtained by the "AIC" or "BIC" criteria, by default "AIC". |
Returns a list with a matrix with the density over the grid,
a matrix with the quantity of data over the grid, the number of subintervals for the variable,
the number of subintervals for the
variable, a matrix with the values of
and
in the copula domain and a matrix with the original values X.
Pfeifer, D., Strassburger, D., & Philipps, J. (2020). Modelling and simulation of dependence structures in nonlife insurance with Bernstein copulas. arXiv. Retrieved from https://arxiv.org/abs/2010.15709
# 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") print(copula.grid$Density) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") print(copula.grid$Density)
# 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") print(copula.grid$Density) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") print(copula.grid$Density)
Draws the density of a grid copula with colors
image_color_grid(gc, color.name = "heat.colors", color.size = 7)
image_color_grid(gc, color.name = "heat.colors", color.size = 7)
gc |
a grid type copula object. |
color.name |
indicates the palette of colors. |
color.size |
indicates the number of colors. |
Returns a graph of the density.
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") image_color_grid(gc = copula.grid, color.name = "rainbow", color.size = 10) #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ml") image_color_grid(gc = copula.grid, color.name = "rainbow", color.size = 10)
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") image_color_grid(gc = copula.grid, color.name = "rainbow", color.size = 10) #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ml") image_color_grid(gc = copula.grid, color.name = "rainbow", color.size = 10)
Returns dependency measures for a grid type copula
measures.grid(gc, measures = "all")
measures.grid(gc, measures = "all")
gc |
a grid type copula object. |
measures |
A vector of the measurements to calculate: "gini", "blomqvist", "tail_U", "tail_L", "rho", "tau","mi", by default "all". |
"tau"
Kendall's , see Nelsen (2007).
"rho"
Spearman's , see Nelsen (2007).
"blomqvist"
Blomqvist's ; computed as
, see Nelsen (2007).
"gini"
Gini's , see Nelsen (2007).
"mi"
Mutual information, see Joe (1989).
"tail_U/tail_L"
Tail dependency, see Nelsen (2007).
A list with dependence measures
Nelsen, R. (2007). An introduction to copulas. Springer Science & Business Media.
Joe, H. (1989). Relative Entropy Measures of Multivariate Dependence. Journal of the American Statistical Association.
# 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") measures.grid(copula.grid) measures.grid(copula.grid, measures = c("rho","tau","mi")) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") measures.grid(copula.grid, measures = c("gini", "blomqvist", "tail_U", "tail_L", "rho"))
# 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") measures.grid(copula.grid) measures.grid(copula.grid, measures = c("rho","tau","mi")) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") measures.grid(copula.grid, measures = c("gini", "blomqvist", "tail_U", "tail_L", "rho"))
Draws the density of a grid copula with mosaics
mosaic.grid(gc, number.size = 5)
mosaic.grid(gc, number.size = 5)
gc |
a grid type copula object. |
number.size |
indicates the size of numbers. |
Returns a graph.
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") mosaic.grid(gc = copula.grid, number.size = 5) #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ml") mosaic.grid(gc = copula.grid, number.size = 5)
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") mosaic.grid(gc = copula.grid, number.size = 5) #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ml") mosaic.grid(gc = copula.grid, number.size = 5)
Returns the corresponding distribution function values.
p.grid(U, V = NULL, gc)
p.grid(U, V = NULL, gc)
U |
a matrix of size |
V |
optional, a vector of size |
gc |
a grid type copula object. |
Returns a vector with the corresponding distribution.
# 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") p.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") p.grid(copula.grid$U,gc=copula.grid)
# 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") p.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") p.grid(copula.grid$U,gc=copula.grid)
Draws the density / distribution function of a grid copula with perspective
perspective.grid( gc, FUN = "d.grid", u1 = seq(0, 1, length.out = 21), u2 = seq(0, 1, length.out = 21), ang.theta = -30, ang.phi = 25, distancia = 10 )
perspective.grid( gc, FUN = "d.grid", u1 = seq(0, 1, length.out = 21), u2 = seq(0, 1, length.out = 21), ang.theta = -30, ang.phi = 25, distancia = 10 )
gc |
a grid type copula object. |
FUN |
the name of the function to be applied (d.grid, p.grid), default is 'd.grid'. |
u1 |
indicates the place for lines on axis |
u2 |
indicates the place for lines on axis |
ang.theta |
angle for the azimuthal direction. |
ang.phi |
angle for the colatitude. |
distancia |
the distance of the eyepoint from the centre of the box. |
Returns a graph of the density / distribution.
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") perspective.grid(gc = copula.grid, ang.theta = 90 , ang.phi = 80, distancia = 3) perspective.grid(gc = copula.grid, FUN = "p.grid") #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ml") perspective.grid(gc = copula.grid, ang.theta = 90 , ang.phi = 80, distancia = 3) perspective.grid(gc = copula.grid, FUN = "p.grid")
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) k <- 10 m <- 10 copula.grid <- estimate.gridCopula(U = df, k = k, m = m , method = "ml") perspective.grid(gc = copula.grid, ang.theta = 90 , ang.phi = 80, distancia = 3) perspective.grid(gc = copula.grid, FUN = "p.grid") #Iris copula.grid <- estimate.gridCopula(X = iris[,1:2], k = k, m = m , method = "ml") perspective.grid(gc = copula.grid, ang.theta = 90 , ang.phi = 80, distancia = 3) perspective.grid(gc = copula.grid, FUN = "p.grid")
Generates a random sample from a grid type copula
r.grid(n, gc)
r.grid(n, gc)
n |
an integer number indicating the size of the sample. |
gc |
a grid type copula object. |
Returns a matrix of size with the random sample.
# 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 = 15, m = 15 , method = "ml") df2 <- r.grid(n = n, gc = copula.grid) data.grid(copula.grid$U, k = 15, m = 15) data.grid(df2, k = 15, m = 15) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") df2 <- r.grid(n = n, gc = copula.grid) data.grid(copula.grid$U, k = 3, m = 7) data.grid(df2, k = 3, m = 7)
# 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 = 15, m = 15 , method = "ml") df2 <- r.grid(n = n, gc = copula.grid) data.grid(copula.grid$U, k = 15, m = 15) data.grid(df2, k = 15, m = 15) # Using the Iris dataset, transformation is not mandatory copula.grid <- estimate.gridCopula(X = iris[,1:2], k = 3, m = 7 , method = "ml") df2 <- r.grid(n = n, gc = copula.grid) data.grid(copula.grid$U, k = 3, m = 7) data.grid(df2, k = 3, m = 7)