Custom S-vine distribution models
Value
Returns the model as an object with class svine_dist
.
A list with entries
$margins
: list of marginal models from univariateML::univariateML_models,$copula
: an object ofsvinecop_dist
.
See also
svine_dist, svine_loglik, svine_sim, svine_bootstrap_models
Examples
## marginal objects
# create dummy univariateML models
univ1 <- univ2 <- univariateML::mlnorm(rnorm(10))
# modify the parameters to N(5, 10) and N(0, 2) distributions
univ1[] <- c(5, 10)
univ2[] <- c(0, 2)
## copula óbject
cs_struct <- cvine_structure(1:2)
pcs <- list(
list( # first tree
bicop_dist("clayton", 0, 3), # cross sectional copula
bicop_dist("gaussian", 0, -0.1) # serial copula
),
list( # second tree
bicop_dist("gaussian", 0, 0.2), bicop_dist("indep")
),
list( # third tree
bicop_dist("indep")
)
)
cop <- svinecop_dist(
pcs, cs_struct, p = 1, out_vertices = 1:2, in_vertices = 1:2)
model <- svine_dist(margins = list(univ1, univ2), copula = cop)
summary(model)
#> $margins
#> # A data.frame: 2 x 5
#> margin name model parameters loglik
#> 1 V1 Normal 5, 10 -12
#> 2 V2 Normal 0, 2 -12
#>
#> $copula
#> # A data.frame: 5 x 10
#> tree edge conditioned conditioning var_types family rotation parameters df
#> 1 1 3, 1 c,c gaussian 0 -0.1 1
#> 1 2 2, 1 c,c clayton 0 3 1
#> 2 1 4, 1 3 c,c gaussian 0 0.2 1
#> 2 2 3, 2 1 c,c indep 0 0
#> 3 1 4, 2 1, 3 c,c indep 0 0
#> tau
#> -0.064
#> 0.600
#> 0.128
#> 0.000
#> 0.000
#>