gammaconvfactor: Gamma convolution factor model

Description Usage Arguments Value See Also Examples

Description

Gamma convolution factor model and its copula

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
rgammaconv(n,th0,thvec)
pmgamfact(xvec,th0,thvec,zero=0)
dmgamfact(xvec,th0,thvec,zero=0)
dmgamfact.gl(xvec,th0,thvec,gl)
pbgamfact(x1,x2,th0,th1,th2,zero=0) 
dbgamfact(x1,x2,th0,th1,th2,zero=0)
dbgamfact.gl(x1,x2,th0,th1,th2,gl)
pbgamfcop(u,v,param)
dbgamfcop(u,v,param,zero=0)
dbgamfcop.gl(u,v,param,gl=gldefault)
pcondbgamfcop21(v,u,param,zero=0)
pcondbgamfcop12(u,v,param,zero=0)
pmgamfcop(uvec,param)
dmgamfcop(uvec,param,zero=0)
dmgamfcop.gl(uvec,param,gl)

Arguments

n

sample size for simulation

th0

scalar for shape parameter of the shared/common component

thvec

vector of shape parameters of individual components, length d

xvec

vector of length d with positive values

uvec

vector of length d with values in (0,1)

gl

Gauss-Legendre object with components $nodes and $weights

x1

positive value for first variable (bivariate case)

x2

positive value for second variable (bivariate case)

th1

scalar for shape parameter of first variable (bivariate case)

th2

scalar for shape parameter of second variable (bivariate case)

zero

tolerance for numerical integration, set as 0.0001 if there are problems

u

value in interval 0,1; could be a vector

v

value in interval 0,1; could be a vector

param

parameter vector with length d+1 with th0,thvec

Value

random sample (nxd matrix) for rgammaconv

cdf or conditional cdf or pdf for remaining functions

See Also

invGaussconvfactor

Examples

 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
n=1000
th0=2
thvec=c(.3,.3)
set.seed(123)
xdat=rgammaconv(n,th0,thvec)
cor(xdat)
#plot(xdat)
gl=gausslegendre(35)
pmgamfact(c(1,1.1),th0,c(.4,.4),zero=0)
dbgamfact(1,1.1,th0,th1=.4,th2=.4,zero=0)
dbgamfact.gl(1,1.1,th0,th1=.4,th2=.4,gl) # could be inaccurate for th1,th2<1
dbgamfact(1,1.1,th0,th1=1.2,th2=1.4,zero=0)
dbgamfact.gl(1,1.1,th0,th1=1.2,th2=1.4,gl) 
dmgamfact(c(1,1.1),th0,c(1.2,1.4),zero=0)
dmgamfact.gl(c(1,1.1),th0,c(1.2,1.4),gl)
# density can be finite on diagonal
try(dbgamfact(1,1.0001,0.1,th1=.4,th2=.4,zero=0))
try(dbgamfact(1,1,0.1,th1=.4,th2=.4,zero=0))
# copula 
pmgamfcop(c(.5,.6),c(2,1.2,1.4))
dmgamfcop(c(.5,.6),c(2,1.2,1.4),zero=0)
dmgamfcop.gl(c(.5,.6),c(2,1.2,1.4),gl)
pcondbgamfcop21(.6,.5,c(2,1.2,1.4),zero=0)
pcondbgamfcop12(.5,.6,c(2,1.2,1.4),zero=0)
pcondbgamfcop21(.5,.6,c(2,1.4,1.2),zero=0)

YafeiXu/CopulaModel documentation built on May 9, 2019, 11:07 p.m.