View source: R/svine_methods.R
| svine_pseudo_residuals | R Documentation |
Pseudo-residuals are defined as the Rosenblatt transform of the data,
conditional on the past. Under a correctly specified model, they are
approximately iid uniform on [0, 1]^d.
svine_pseudo_residuals(x, model, cores = 1)
x |
the data. |
model |
model inheriting from class svine_dist. |
cores |
number of cores to use; if larger than one, computations are
performed in parallel on |
An n-by-d matrix of pseudo-residuals, where
n = NROW(x) - model$copula$p and d is the cross-sectional dimension.
# load data set
data(returns)
dat <- returns[1:100, 1:3]
# fit parametric S-vine model with Markov order 1
fit <- svine(dat, p = 1, family_set = "parametric")
# compute pseudo-residuals
# (should be independent uniform across variables and time)
v <- svine_pseudo_residuals(dat, fit)
pairs(cbind(v[-1, ], v[-nrow(v), ]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.