Description Usage Arguments Details Value Author(s) References See Also Examples
This function makes simulations of correlated or dependent gaussian shocks for risk factors.
1 2 3 4 5 6 7 8 9 10 11 |
n |
number of independent observations for each risk factor. |
horizon |
horizon of projection. |
frequency |
either "annual", "semi-annual", "quarterly", "monthly", "weekly", or "daily" (1, 1/2, 1/4, 1/12, 1/52, 1/252). |
method |
either classic monte carlo, antithetic variates, moment matching, hybrid antithetic variates + moment matching or "TAG" (see the 4th reference for the latter). |
family |
the same as |
par |
the same as |
par2 |
the same as |
type |
type of the vine model: 1 : C-vine 2 : D-vine |
seed |
reproducibility seed |
The function shall be used along with simdiff
, in order to embed
correlated or dependent random gaussian shocks into simulated diffusions.
esgplotshocks
can help in visualizing the type of dependence
between the shocks.
If family
and par
are not provided, a univariate time
series object with simulated gaussian shocks for one risk factor. Otherwise,
a list of time series objects, containing gaussian shocks for each risk factor.
Thierry Moudiki
Brechmann, E., Schepsmeier, U. (2013). Modeling Dependence with C- and D-Vine Copulas: The R Package CDVine. Journal of Statistical Software, 52(3), 1-27. URL http://www.jstatsoft.org/v52/i03/.
Genz, A. Bretz, F., Miwa, T. Mi, X., Leisch, F., Scheipl, F., Hothorn, T. (2013). mvtnorm: Multivariate Normal and t Distributions. R package version 0.9-9996.
Genz, A. Bretz, F. (2009), Computation of Multivariate Normal and t Probabilities. Lecture Notes in Statistics, Vol. 195., Springer-Verlag, Heidelberg. ISBN 978-3-642-01688-2.
Nteukam T, O., & Planchet, F. (2012). Stochastic evaluation of life insurance contracts: Model point on asset trajectories and measurement of the error related to aggregation. Insurance: Mathematics and Economics, 51(3), 624-631. URL http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/ab539dcebcc4e77ac12576c6004afa67/$FILE/Article_US_v1.5.pdf
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 | # Number of risk factors
d <- 6
# Number of possible combinations of the risk factors
dd <- d*(d-1)/2
# Family : Gaussian copula for all
fam1 <- rep(1,dd)
# Correlation coefficients between the risk factors (d*(d-1)/2)
par1 <- c(0.2,0.69,0.73,0.22,-0.09,0.51,0.32,0.01,0.82,0.01,
-0.2,-0.32,-0.19,-0.17,-0.06)
# Simulation of shocks for the 6 risk factors
simshocks(n = 10, horizon = 5, family = fam1, par = par1)
# Simulation of shocks for the 6 risk factors
# on a quarterly basis
simshocks(n = 10, frequency = "quarterly", horizon = 2, family = fam1,
par = par1)
# Simulation of shocks for the 6 risk factors simulation
# on a quarterly basis, with antithetic variates and moment matching.
s0 <- simshocks(n = 10, method = "hyb", horizon = 4,
family = fam1, par = par1)
s0[[2]]
colMeans(s0[[1]])
colMeans(s0[[5]])
apply(s0[[3]], 2, sd)
apply(s0[[4]], 2, sd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.