Description Usage Arguments Details Value Examples
Finds copula models for each pair of response and predictor in some order, so that the pair is conditional on previous predictors.
1 2 3 4 5 6 7 8 9 10 |
y |
Vector of response observations. |
xdat |
Matrix of predictors. Columns are variables, rows are observations
(that correspond with entries of |
ymarg |
Vectorized function of the cdf of the response. |
xmargs |
List of vectorized functions of the cdfs of the univariate
predictors, in the order of the columns of |
xord |
If you already know what order you want to pair the response and the predictors, put that order here as a vector of "column numbers". |
cops |
If you already know some of the copula models that you'd like
to use corresponding to the variables in |
families |
A vector of copula family names to try
fitting (will also consider their rotations/reflections). Limited to
those families available in |
... |
Other arguments to pass to |
This function first determines the order to pair up the response
and predictors in the order of highest partial correlation (by using
lm
). Then the bivariate copula models are chosen and fitted
individually using VineCopula::BiCopSelect
.
By "pairing response and predictors in some order", I mean pairing (Y,X1), (Y,X2)|X1, (Y,X3)|(X1,X2), etc, though not necessarily in that order.
For the familyset
argument, the default is almost all of
the families available. It just doesn't include the Tawn copula families.
A list with three entries:
$xord
: The pairing order, as a vector of the column numbers
of xdat
.
$cops
: A vector of copula family names corresponding to
the pairs in the order in $xord
.
$cparstart
: A list of copula parameters corresponding to
the families in $cops
, which should be taken as starting values
for an optimization (obtained by bivariate likelihood). If each entry
of the list is a vector of length one, then a vector of those values
is returned here instead.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Get some simulated data:
set.seed(6277)
p <- 5
A0 <- CopulaModel::Dvinearray(p)
copmat0 <- makeuppertri("frk", p-1, p, "")
cparmat0 <- makeuppertri(3, p-1, p)
dat <- fvinesim(100, A0, copmat0, cparmat0)
y <- dat[, 1]
xdat <- dat[, -1]
## Fit the model:
fit.BN(y, xdat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.