CDVineCondFit {CDVineCopulaConditional}  R Documentation 
This function fits either a C or a D vine model to a ddimensional dataset of uniform variables.
The fit of the paircopula families is performed sequentially through the function RVineCopSelect
of
the package VineCopula
. The vine structure is selected among a group of C and a D vines which satisfy the requirement
discussed in Bevacqua et al. (2017). This group is composed by all C and D vines from which the conditioning variables
would be sampled as first when following the algorithms from Aas et al. (2009). Alternatively, if the
vine matrix describing the vine structure is given to the function, the fit of the paircopulas is directly performed skipping the vine structure
selection procedure.
CDVineCondFit(data, Nx, treecrit = "AIC", type = "CVineDVine",
selectioncrit = "AIC", familyset = NA, indeptest = FALSE,
level = 0.05, se = FALSE, rotations = TRUE, method = "mle",
Matrix = FALSE)
data 
An 
Nx 
Number of conditioning variables. 
treecrit 
Character indicating the criteria used to select the vine. All possible vines are fitted trough
the function 
type 
Type of vine to be fitted: 
selectioncrit 
Character indicating the criterion for paircopula selection.
Possible choices are 
familyset 
"Integer vector of paircopula families to select from. The vector has to include at least one
paircopula family that allows for positive and one that allows for negative
dependence. Not listed copula families might be included to better handle
limit cases. If 
indeptest 
Logical; whether a hypothesis test for the independence of

level 
numeric; significance level of the independence test (default:

se 
Logical; whether standard errors are estimated (default: 
rotations 
logical; if 
method 
indicates the estimation method: either maximum
likelihood estimation ( 
Matrix 

An RVineMatrix
object describing the selected copula model
(for further details about RVineMatrix
objects see the documentation file of the VineCopula
package).
The selected families are stored
in $family
, and the sequentially estimated parameters in $par
and $par2
.
The fit of the model is performed via the function RVineCopSelect
of the package VineCopula
.
"The object RVineMatrix
includes the following information about the fit:
se, se2
standard errors for the parameter estimates (if se = TRUE
; note that these are only
approximate since they do not account for the sequential nature of the estimation,
nobs
number of observations,
logLik, pair.logLik
log likelihood (overall and pairwise)
AIC, pair.AIC
Aikaike's Informaton Criterion (overall and pairwise),
BIC, pair.BIC
Bayesian's Informaton Criterion (overall and pairwise),
emptau
matrix of empirical values of Kendall's tau,
p.value.indeptest
matrix of pvalues of the independence test.
For a comprehensive summary of the vine copula model, use
summary(object)
; to see all its contents, use str(object)
". (VineCopula Documentation, version 2.1.1, pp. 103)
Emanuele Bevacqua
Bevacqua, E., Maraun, D., Hobaek Haff, I., Widmann, M., and Vrac, M.: Multivariate statistical modelling of compound events via paircopula constructions: analysis of floods in Ravenna (Italy), Hydrol. Earth Syst. Sci., 21, 27012723, https://doi.org/10.5194/hess2127012017, 2017. [link] [link]
Aas, K., Czado, C., Frigessi, A. and Bakken, H.: Paircopula constructions of multiple dependence, Insurance: Mathematics and Economics, 44(2), 182198, <doi:10.1016/j.insmatheco.2007.02.001>, 2009. [link]
Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler, Thomas Nagler and Tobias Erhardt (2017). VineCopula: Statistical Inference of Vine Copulas. R package version 2.1.1. [link]
# Example 1
# Read data
data(dataset)
data < dataset$data[1:100,1:5]
# Define the variables Y and X. X are the conditioning variables,
# which have to be positioned in the last columns of the data.frame
colnames(data) < c("Y1","Y2","X3","X4","X5")
## Not run:
# Select and fit a C vine copula model, requiring that the
RVM < CDVineCondFit(data,Nx=3,treecrit="BIC",type="CVine",selectioncrit="AIC")
summary(RVM)
RVM$Matrix
## End(Not run)
# Example 2
# Read data
data(dataset)
data < dataset$data[1:80,1:5]
# Define the variables Y and X. X are the conditioning variables,
# which have to be positioned in the last columns of the data.frame
colnames(data) < c("Y1","Y2","X3","X4","X5")
# Define a VineMatrix which can be used for conditional sampling
ListVines < CDVineCondListMatrices(data,Nx=3)
Matrix=ListVines$DVine[[1]]
Matrix
## Not run:
# Fit copula families for the defined vine:
RVM < CDVineCondFit(data,Nx=3,Matrix=Matrix)
summary(RVM)
RVM$Matrix
RVM$family
# check
identical(RVM$Matrix,Matrix)
# Fit copula families for the defined vine, given a group of families to select from:
RVM < CDVineCondFit(data,Nx=3,Matrix=Matrix,familyset=c(1,2,3,14))
summary(RVM)
RVM$Matrix
RVM$family
# Try to fit copula families for a vine which is not among those
# that allow for conditional sampling:
Matrix
Matrix[which(Matrix==4)]=40
Matrix[which(Matrix==2)]=20
Matrix[which(Matrix==40)]=2
Matrix[which(Matrix==20)]=4
Matrix
RVM < CDVineCondFit(data,Nx=3,Matrix=Matrix)
RVM
## End(Not run)