Learn R Programming

CopulaRegression (version 0.1-5)

simulate_joint: Simulation from the joint model

Description

Simulation from the joint model

Usage

simulate_joint(n, mu, delta, lambda, theta, family, max.y = 5000, eps = 1e-05,zt=TRUE)

Arguments

n
number of samples
mu
expectation of the Gamma distribution
delta
dispersion parameter of the Gamma distribution
lambda
parameter of the (zero-truncated) Poisson distribution
theta
copula parameter
family
an integer defining the bivariate copula family: 1 = Gauss, 3 = Clayton, 4=Gumbel, 5=Frank
max.y
upper value for the conditional (zero truncated) Poisson variable, see below for more details
eps
precision, see below for more details
zt
logical. If zt=TRUE, we use a zero-truncated Poisson variable. Otherwise, we use a Poisson variable. Default is TRUE.

Value

  • n samples, stored in a $n \times 2$ matrix

Details

For a Gamma distributed variable X and a (zero truncated) Possion variable Y, we sample from their joint distribution that is given by the density function $$f_{XY}(x,y)=f_X(x) \left(D_u(F_Y(y),F_X(x)|\theta) - D_u(F_Y(y-1),F_X(x)|\theta) \right)\,.$$Here $D_u$ is the h-function of a copula famila family with copula parameter theta. First, we sample n observations x from the marginal Gamma distribution. Second, for each x, we then sample an observation from the conditional distribution of Y given X=x. In the second step, the conditional distribution is evaluated up to the maximum of max.y and the smallest integer > y.max for which the conditional probability is smaller than eps.

References

N. Kraemer, E. Brechmann, D. Silvestrini, C. Czado (2013): Total loss estimation using copula-based regression models. Insurance: Mathematics and Economics 53 (3), 829 - 839.

See Also

density_joint, simulate_regression_data,density_conditional

Examples

Run this code
library(VineCopula)
n<-100 # number of observations
mu<-1000
delta<-0.09
lambda<-2.5
family<-1
theta<-BiCopTau2Par(tau=0.5,family=family)
my.data<-simulate_joint(n,mu,delta,lambda,theta,family)

Run the code above in your browser using DataLab