rcopula: Random Number Generation for Copula Functions.

Description Usage Arguments Value Author(s) Examples

View source: R/rcopula.R

Description

Random Number Generation for Bivariate Copula Functions. Returns a number of pairs of random values from a bivariate copula with marginal distributions X and Y.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
rcopula(
  typeCopula = "clayton",
  theta = 1,
  typeX = "Exp",
  num1_X = 1,
  num2_X = NULL,
  typeY = "Exp",
  num1_Y = 1,
  num2_Y = NULL,
  nsim = 500
)

Arguments

typeCopula

Type of copula. Possible options are "clayton", "frank" "FGM", "AMH", "gumbel-hougaard" and "joe". Defaults to "clayton".

theta

A numeric value for the space parameter.

typeX

Type of marginal distribution. Possible options are "Exp", "Norm" "Unif" and "Gamma". Defaults to "Exp".

num1_X

A numeric value for the first parameter of the first marginal distribution.

num2_X

A numeric value for the second parameter of the first marginal distribution. Only required for two parameter distributions.

typeY

Type of marginal distribution. Possible options are "Exp", "Norm" "Unif" and "Gamma". Defaults to "Exp".

num1_Y

A numeric value for the first parameter of the second marginal distribution.

num2_Y

A numeric value for the second parameter of the second marginal distribution. Only required for two parameter distributions.

nsim

Number of observations to be generated.

Value

2-dimensional random vector with the results of the simulation.

Author(s)

Gustavo Soutinho, Luis Meira-Machado

Examples

1
2
3
4
5
6
7
8
9
res<-rcopula(typeCopula = 'clayton', theta = 2, typeX='Exp', num1_X=0.9, 
             typeY='Exp', num1_Y=0.3, nsim=1000)

res

res2<-rcopula(typeCopula = 'AMH', theta = 2, typeX='Norm', num1_X=0.9, num2_X=0.3, 
              typeY='Gamma', num1_Y=3, num2_Y=2, nsim=1000)
              
res2[,2]

gsoutinho/survCopula documentation built on Sept. 4, 2020, 3:54 a.m.