Description Usage Arguments Details Value Examples
Fits a joint distribution for the data using a vine copula. The vine array
is first chosen using the minimum spanning tree algorithm using
the function gausstrvine.mst
in the CopulaModel
package, then the pairwise
copula models are chosen and fit using RVineCopSelect
in the
VineCopula
package.
1 |
dat |
Matrix of data having Uniform marginal distributions; columns represent variables, and rows observations. |
... |
Other arguments to pass to |
rv |
Object of class "rvine", representing a pre-specification of the
vine to fit. Or, |
var |
Vector of integers specifying the column numbers of |
ntrunc |
Integer, either |
families |
A vector of copula family names to try
fitting (will also consider their rotations/reflections). Limited to
those families available in |
If you want to specify parts of the vine, then specify them in an "rvine" object
(see rvine
):
Your first option is to specify the vine array A
.
If the vine array is specified, then you can specify some or all
of the copula families by putting them in copmat
. Leave
unspecified edges as NA
.
If there are copula families specified, you can specify parameters
for those families by putting the parameters in cparmat
.
Unspecified parameters should be NA
.
For parts of the vine that are unspecified, you have some fitting options:
If you didn't specify a vine array A
, you can select which
variables (column numbers of dat
) you'd like to fit through the
var
argument. You can also select the truncation level of
the vine array through the argument ntrunc
.
If you left some copula families unspecified, you can indicate
the candidate families in the families
argument.
A "fitrvine" object, which has class c("fitrvine", "rvine")
,
which is a named list of the following:
$A
: Vine array, truncated to ntrunc
.
$copmat
: ntrunc x ncol(A)
upper-triangular
matrix of copula model names.
$cparmat
: ntrunc x ncol(A)
upper-triangular
matrix of copula parameters. Each entry is a list of length one containing
the vector of copula parameters for that copula family.
$dat
: The inputted data matrix, dat
.
$aic
: The AIC of the fitted model.
$bic
: The BIC of the fitted model.
$nllh
: The negative log likelihood of the fitted model.
$covmat
: Covariance matrix of the fitted parameters (in
reading-order of the parameters, i.e.
c(t(cparmat)[lower.tri(t(cparmat))], recursive=TRUE)
).
1 2 3 4 5 6 7 8 9 10 11 12 | ## Get some simulated data:
set.seed(152)
ntrunc <- 2
d <- 4
A0 <- truncvarray(CopulaModel::Dvinearray(d), ntrunc)
copmat0 <- makeuppertri("frk", ntrunc, d, "")
cparmat0 <- makeuppertri(3, ntrunc, d)
dat <- fvinesim(100, A0, copmat0, cparmat0)
## Fit a model to the data:
fit.rvine(dat, ntrunc=ntrunc)
fit.rvine(dat, c(4, 2, 3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.