svinecop_sim {svines} | R Documentation |
Simulate from a S-vine copula model
Description
Simulate from a S-vine copula model
Usage
svinecop_sim(n, rep, model, past = NULL, qrng = FALSE, cores = 1)
Arguments
n |
how many steps of the time series to simulate. |
rep |
number of replications; |
model |
a S-vine copula model object (inheriting from svinecop_dist). |
past |
(optional) matrix of past observations. If provided, time series are simulated conditional on the past. |
qrng |
if |
cores |
number of cores to use; if larger than one, computations are done parallel over replications. |
Value
An n
-by-d
-by-rep
array, where d
is the cross-sectional
dimension of the model. This reduces to an n
-by-d
matrix if rep == 1
.
Examples
# load data set
data(returns)
# convert to uniform margins
u <- pseudo_obs(returns[1:100, 1:3])
# fit parametric S-vine copula model with Markov order 1
fit <- svinecop(u, p = 1, family_set = "parametric")
pairs(u) # original data
pairs(svinecop_sim(100, rep = 1, model = fit)) # simulated data
# simulate the next day conditionally on the past 500 times
pairs(t(svinecop_sim(1, rep = 100, model = fit, past = u)[1, , ]))
[Package svines version 0.2.3 Index]