I am generating a matrix of probabilities from a bivariate gaussian copula with poisson marginals. I can't figure out why probabilities doesn't add to 1 but to slightly more. Here is the code:
library(copula) cop<-normalCopula(param = 0.92, dim = 2) mv <- mvdc(cop, c("pois", "pois"),list(list(lambda = 6), list(lambda = 4))) m <- matrix(NA,50,50) for (i in 0:49) { for (j in 0:49) { m[i+1,j+1]=dMvdc(c(i,j),mv) } } sum(m) [1] 1.048643
EDIT: It seems that this problem is present only when the param
parameter (the correlation) is different from 0.
Copula is a probability model that represents a multivariate uniform distribution, which examines the association or dependence between many variables. Put differently, a copula helps isolate the joint or marginal probabilities of a pair of variables that are enmeshed in a more complex multivariate system.
Copulas and Rank Order Correlation are two ways to model and/or explain the dependence between 2 or more variables. Historically used in biology and epidemiology, copulas have gained acceptance and prominence in the financial services sector.
Copulas are popular in high-dimensional statistical applications as they allow one to easily model and estimate the distribution of random vectors by estimating marginals and copulae separately. There are many parametric copula families available, which usually have parameters that control the strength of dependence.
The simplest copula is the uniform density for independent draws, i.e., c(u,v) = 1, C(u,v) = uv. Two other simple copulas are M(u,v) = min(u,v) and W(u,v) = (u+v–1)+, where the “+” means “zero if negative.” A standard result, given for instance by Wang[8], is that for any copula 3 Page 4 C, W(u,v) ≤ C(u,v) ≤ M(u,v).
This is what dMvdc
does:
Here is the density of your copula, are the probability densities of your choice (in this case dpois
), and are the corresponding cdf's (in this case ppois
).
For this to represent a valid probability distribution, i.e. to integrate to 1, you need to be able to do the final substitution below, which requires continuous probability distributions:
If you use discrete pdf's (via Dirac deltas):
the above will generally fail:
which is what you observed.
The 0 correlation case works accidentally, because in that case is simply the identity function:
dCopula(c(runif(1), runif(1)), normalCopula(0)) #[1] 1
I'm not sure if the copula can be normalized appropriately to salvage the non-zero correlation case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With