esgplotshocks: Visualize the dependence between 2 gaussian shocks

Description Usage Arguments Author(s) References See Also Examples

View source: R/plots.R

Description

This function helps you in visualizing the dependence between 2 gaussian shocks.

Usage

1

Arguments

x

an output from simshocks, a list with 2 components.

y

an output from simshocks, a list with 2 components (Optional).

Author(s)

Thierry Moudiki + some nice blogs :)

References

H. Wickham (2009), ggplot2: elegant graphics for data analysis. Springer New York.

See Also

simshocks

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Number of risk factors
d <- 2

# Number of possible combinations of the risk factors
dd <- d*(d-1)/2

# Family : Gaussian copula 
fam1 <- rep(1,dd)
# Correlation coefficients between the risk factors (d*(d-1)/2)
par0.1 <- 0.1
par0.2 <- -0.9

# Family : Rotated Clayton (180 degrees)
fam2 <- 13
par0.3 <- 2

# Family : Rotated Clayton (90 degrees)
fam3 <- 23
par0.4 <- -2

# number of simulations
nb <- 500

# Simulation of shocks for the d risk factors
s0.par1 <- simshocks(n = nb, horizon = 4, 
family = fam1, par = par0.1)

s0.par2 <- simshocks(n = nb, horizon = 4, 
family = fam1, par = par0.2)

s0.par3 <- simshocks(n = nb, horizon = 4, 
family = fam2, par = par0.3)

s0.par4 <- simshocks(n = nb, horizon = 4, 
family = fam3, par = par0.4)

## Not run: 
esgplotshocks(s0.par1, s0.par2)
esgplotshocks(s0.par2, s0.par3)
esgplotshocks(s0.par2, s0.par4)
esgplotshocks(s0.par1, s0.par4)
## End(Not run) 

ESGtoolkit documentation built on July 1, 2020, 11:24 p.m.