Fit a vine copula
fit_vine_copula.RdA vine fitted to data tree by tree, each edge's pair copula chosen as
select_pair_copula() chooses on the conditional values the trees below
give at their estimates (sequential maximum likelihood). On a given R-vine
matrix this is rvinecopulib's vinecop(data, structure = matrix);
without one the structure is chosen by Dissmann's algorithm, as
vinecop(data): each tree the spanning tree of largest total |tau|
over the edges the proximity condition allows.
Usage
fit_vine_copula(
data,
matrix = NULL,
families = NULL,
criterion = c("aic", "bic"),
independence_test = NULL,
trunc_level = NULL
)Arguments
- data
A matrix with one row an observation and one column a variable, values in
(0, 1)(takepseudo_obs()of each column of raw data first).- matrix
An R-vine matrix as for
rvine_copula(), orNULLto select the structure.- families
Families to try;
NULLfor the Gaussian, Student, Clayton, Gumbel, Frank and Joe.- criterion
"aic"or"bic".- independence_test
A level for the independence test, or
NULL.- trunc_level
The number of trees to fit, or
NULLfor all.
Value
A list with copula (an R-vine copula), matrix, pairs,
log_likelihood, n_parameters, aic and bic.
Examples
u <- copula_sample(gaussian_copula(matrix(c(1, 0.7, 0.5, 0.7, 1, 0.3, 0.5, 0.3, 1), 3)),
1000, seed = 1)
fit <- fit_vine_copula(u)
fit$matrix
#> [,1] [,2] [,3]
#> [1,] 1 3 3
#> [2,] 3 1 0
#> [3,] 2 0 0
fit$aic
#> [1] -975.732