simulate_joint: Simulation from the joint model

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/simulate_joint.R

Description

Simulation from the joint model

Usage

1
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.

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) ≤ft(D_u(F_Y(y),F_X(x)|θ) - D_u(F_Y(y-1),F_X(x)|θ) \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.

Value

n samples, stored in a n \times 2 matrix

Author(s)

Nicole Kraemer

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

1
2
3
4
5
6
7
8
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)

CopulaRegression documentation built on May 29, 2017, 5:47 p.m.