Description Usage Arguments Author(s) References See Also Examples
This function helps you in visualizing the dependence between 2 gaussian shocks.
1 | esgplotshocks(x, y = NULL)
|
x |
an output from |
y |
an output from |
Thierry Moudiki + some nice blogs :)
H. Wickham (2009), ggplot2: elegant graphics for data analysis. Springer New York.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.