Description Usage Arguments Value References Examples
Copula based on generalized beta of order 2
1 2 3 4 5 6 7 8 9 10 11 | dbgb2(y1,y2,param) # bivariate density
pbgb2(y1,y2,param) # bivariate cdf
dbgb2cop(u,v,param) # bivariate copula density
pbgb2cop(u,v,param) # bivariate copula cdf
pcondbgb2cop(v,u,param) # bivariate copula conditional cdf
dmgb2(yvec,param) # multivariate density
dmgb2cop(uvec,param) # multivariate copula density
logdmgb2cop(uvec,param) # log of multivariate copula density
rmgb2cop(n,param) # simulation
bgb2.cpar2lm(param) # upper tail dependence
mgb2.cpar2cor(param) # correlation matrix if zeta>2
|
y1 |
positive value; could be a vector |
y2 |
positive value; could be a vector |
yvec |
positive vector of length d |
u |
value in interval (0,1); could be a vector |
v |
value in interval (0,1); could be a vector |
uvec |
vector of length d; values in (0,1) |
param |
parameter vector of dimension d+1; (eta1,eta2,zeta) for bivariate and (etavec,zeta) for d-variate; all parameters are positive |
n |
simulation sample size |
pdf for dbgb2, dmgb2, dbgb2cop, dmgb2cop;
cdf for pbgb2, pbgb2cop;
conditional cdf for pcondbgb2cop;
log density for logdmgb2cop (use for maximum likelihood);
random d-vectors for rmgb2cop;
upper tail dependence parameter for bgb2.cpar2lm;
correlation matrix for mgb2.cpar2cor
Yang X, Frees EW, Zhang Z (2011). A generalized beta copula with applications in modeling multivariate long-tailed data. Insurance: Mathematics and Economics 49, 265-284.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | y1=2; y2=3;
param=c(1.5,1.8,2.3)
dbgb2(y1,y2,param)
dmgb2(c(y1,y2),param) # same as above
u1=.2; u2=.3;
dbgb2cop(u1,u2,param)
dmgb2cop(c(u1,u2),param) # same as above
n=1000
param=c(4.5,4.8,2.3)
set.seed(124)
udat=rmgb2cop(n,param)
print(cor(udat))
cat("compare theoretical\n")
print(mgb2.cpar2cor(param))
dmgb2copnllk= function(param,udat)
{ n=nrow(udat)
if(any(param<=0)) return(1.e10)
nllk=0
for(i in 1:n) nllk=nllk-logdmgb2cop(udat[i,],param)
nllk
}
out=nlm(dmgb2copnllk,p=param,udat=udat,hessian=TRUE,print.level=1,iterlim=20)
print(sqrt(diag(solve(out$hess))))
## Not run:
# contour of density with N(0,1) margins
zvec=seq(-3,3,.2)
contourBivCop(param,zvec,dcop=dbgb2cop)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.