estimate.gridCopula {GRIDCOPULA} | R Documentation |
Estimates the parameters of a grid type copula
Description
This function estimates grid type copulas by one of the following methods: maximum likelihood or least squares (See reference).
Usage
estimate.gridCopula(
X = NULL,
U = NULL,
k = NULL,
m = NULL,
method = "ml",
D.ini = NULL,
criterion = "AIC"
)
Arguments
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". |
Value
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 U_2
variable,
the number of subintervals for the U_1
variable, a matrix with the values of u_1
and u_2
in the copula domain and a matrix with the original values X.
References
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
Examples
# 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)