# Find PDF and CDF for bivariate distribution in R

I have a bivariate data with A=log-logistic B=weibull distribution;

 A <- c(12.05, 9.91, 9.31, 1.4, 1.02, 3, 1.58, 3.08, 1.14, 2.09, 16.33, 2.62,
3.36, 1.08, 4.92, 1.53, 7.33, 1.38, 3.9, 4.87, 1.56, 2.38, 1.33, 1.55, 1.8,
5.61, 6.11, 1.57, 1.56, 5.07, 3.36, 2.48, 1.14, 3.21, 1.06, 1.07, 10.81, 1.12,
2.33, 1.15, 12.04, 15.29, 1.31, 1.23, 8.11, 2.25, 2.19, 1.17, 7.07, 2.64)

B <- c(6,5,3,1,1,2,1,2,1,2,8,2,3,1,4,1,4,1,2,4,1,2,1,1,1,4,4,1,1,3,3,2,
1,2,1,1,5,1,2,1,7,7,1,1,3,2,1,1,3,2)

df <- cbind(A, B)


How to find the PDF and CDF for this bivariate distribution (df) by using R? Actually I want to make a comparison between (above) PDF/ CDF with the generated data from Copula (below);

library("actuar")
library("copula")

copula_dist <- mvdc( copula = normalCopula(dim=2, 0.9628832),
margins = c("llogis", "weibull"),
paramMargins = list(list(shape=2.065426, scale=2.595016),
list(shape=1.481845, scale=2.68271)))

sim <- rMvdc(length(df[, 1]), copula_dist)
cdf_mvd <- pMvdc(sim, copula_dist)
pdf_mvd <- dMvdc(sim, copula_dist)

• What do you mean by "I want to make a comparison" ? As far as my limited understanding goes concerning copulas, aren't both just kernel densities estimations? How do you want to compare them? – KenHBS Dec 4 '17 at 7:46
• Hi Ken S., I want to compare the CDF value between observed data with simulated data by using MAE. "data" is my observed data and "sim: is my simulated data. I'm trying to find the best copula (lowest MAE) that can fit to my observed data – Rosbert Dec 4 '17 at 8:20
• @Rosbert, what MAE means? – Nick Dec 28 '17 at 7:37