{"word_count": 581, "character_count": 5056}
When introducing copulas, it is commonly admitted that copulas are interesting because they allow to model the marginals and the dependence structure separately. The motivation is probably Sklar's theorem, which says that given some marginal cumulative distribution functions (say  and , in dimension 2), and a copula (denoted ), then we can generate a multivariate cumulative distribution function with marginals the one specified previously, usingBut this separability might be misleading. Consider the case of a fully parametric model,Assume that those distributions are continuous, so that we can write the likelihood using densities,and the log-likelihood isThe first part is the log-likelihood if we consider the first marginal (only). The second part is the log-likelihood if we consider the second marginal (only). If the two components are not independent (i.e. the copula density  is not equal to 1 everywhere) the third part cannot be considered as null, and so, in a general context,wherewhileIn order to illustrate this point, consider a bivariate lognormal distribution (obtained by taking the exponential of a Gaussian vector)&#62; mu1=1&#62; mu2=2&#62; MU=c(mu1,mu2)&#62; s1=1&#62; s2=sqrt(2)&#62; r=.8&#62; SIGMA=matrix(c(s1^2,r*s1*s2,r*s1*s2,s2^2),2,2)&#62; library(mnormt)&#62; set.seed(1)&#62; Z=exp(rmnorm(25,MU,SIGMA))If we believe that marginals and correlations can be treated separately, we can start with marginal distributions.&#62; library(MASS)&#62; (p1=fitdistr(Z[,1],"lognormal"))    meanlog      sdlog    1.1686652   0.9309119  (0.1861824) (0.1316508)&#62; (p2=fitdistr(Z[,2],"lognormal"))    meanlog      sdlog    2.2181721   1.1684049  (0.2336810) (0.1652374)Based on those marginal distributions, define  and , and consider the maximum likelihood estimator  of the copula parameter, obtained from this pseudo sample,Numerically, we get (since we consider a Gaussian copula, which is the true copula generated here)&#62; library(copula)&#62; Gcop=normalCopula(.3,dim=2)&#62; U=cbind(plnorm(Z[,1],p1$estimate[1],p1$estimate[2]),+ plnorm(Z[,2],p2$estimate[1],p2$estimate[2]))&#62; fitCopula(Gcop,data=U,method="ml")fitCopula() estimation based on 'maximum likelihood'and a sample of size 25.      Estimate Std. Error z value Pr(&#62;|z|)    rho.1  0.86530    0.03799   22.77But clearly, we did not treat the dependence structure separately, since it was a function of marginal distributions,If we consider a global optimization problem, then results are different. The joint density can be derived (see e.g. Mostafa &#38; Mahmoud (1964))&#62; dbivlognorm=function(x,theta){+ mu1=theta[1]+ mu2=theta[2]+ s1=theta[3]+ s2=theta[4]+ r=theta[5]+ a1=(log(x[,1])-mu1)/s1+ a2=(log(x[,2])-mu2)/s2+ d=1/(2*pi*s1*s2*sqrt(1-r^2))*1/(x[,1]*x[,2])*+ exp(-(a1^2-2*r*a1*a2+a2^2)/(2*(1-r^2)))+ return(d)+ }&#62; LogLik=function(theta){+ return(-sum(log(dbivlognorm(Z,theta))))}&#62; optim(par=c(0,0,1,1,0),fn=LogLik)$par[1] 1.1655359 2.2159767 0.9237853 1.1610132 0.8645052The difference is not huge, but still. The estimators are not identical. From a statistical point of view, we can hardly treat the marginals and the dependence structure separately.Another point we should keep in mind is that the estimation of the copula parameter depends on the margins, not only through the parameters, but more deeply, through the choice of the marginal distributions (that might be misspecified). For instance, if we assume that margins are exponentially distributed,&#62; (p1=fitdistr(Z[,1],"exponential"))      rate     0.22288362  (0.04457672)&#62; (p2=fitdistr(Z[,2],"exponential"))      rate     0.06543665  (0.01308733)the estimation of the parameter of the Gaussian copula yields&#62; U=cbind(pexp(Z[,1],p1$estimate[1]),+ pexp(Z[,2],p2$estimate[1]))&#62; fitCopula(Gcop,data=U,method="ml")fitCopula() estimation based on 'maximum likelihood'and a sample of size 25.      Estimate Std. Error z value Pr(&#62;|z|)    rho.1  0.87421    0.03617   24.17   &#60;2e-16 ***---Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1The maximized loglikelihood is  15.4 Optimization convergedThe problem is that since we misspecify marginal distribution, our pseudo sample is defined on the unit-interval, but there is no chance that we get uniform margins. If we generate a sample of size 500 with the code above,&#62; x &#60;- U[,1]; y &#60;- U[,2]&#62; xhist &#60;- hist(x, plot=FALSE) ; yhist &#60;- hist(y, plot=FALSE)&#62; top &#60;- max(c(xhist$counts, yhist$counts)) &#62; nf &#60;- layout(matrix(c(2,0,1,3),2,2,byrow=TRUE), c(3,1), c(1,3), TRUE) &#62; par(mar=c(3,3,1,1)) &#62; plot(x, y, xlab="", ylab="",col="red",xlim=0:1,ylim=0:1) &#62; par(mar=c(0,3,1,1))&#62; barplot(xhist$counts, axes=FALSE, ylim=c(0, top), + space=0,col="light green") &#62; par(mar=c(3,0,1,1))&#62; barplot(yhist$counts, axes=FALSE, xlim=c(0, top), + space=0, horiz=TRUE,col="light blue")If we compare with the previous case, when marginal distribution were well-specified, we can clearly see that the dependence structure depends on marginal distributions,