library(VineCopula)
 n<-200 # number of examples
 R<-S<-cbind(rep(1,n),rnorm(n)) # design matrices with intercept 
 alpha<-beta<-c(1,-1) # regression coefficients
 exposure<-rep(1,n) # constant exposure
 delta<-0.5 # dispersion parameter
 tau<-0.3 # Kendall's tau
 family=3 # Clayton copula
 theta<-BiCopTau2Par(tau=tau,family=family)
 # simulate data
  my.data<-simulate_regression_data(n,alpha,beta,R,S,delta,tau,family,TRUE,exposure)
 x<-my.data[,1]
 y<-my.data[,2]
 #compute loglikelihood for the true coefficients
 out<-loglik_joint(alpha,beta,theta,delta,x,y,R,S,family,exposure)Run the code above in your browser using DataLab