Description Usage Arguments Details Value Examples
Evaluates the conditional distribution of a variable in a regular vine out of all specified variables. As of now, will likely only work if the vine is regular, and truncated in the traditional sense.
1 | pcondrvine(dat, rv, var, condset, maxint = 2, verbose = FALSE)
|
dat |
vector or matrix of uniform observations (columns are variables). |
rv |
Regular vine object. |
var |
Integer; the variable you wish to condition on (i.e. the
column number of |
condset |
Vector of the conditioning variables (integers). Optional;
leave blank to condition |
maxint |
Integer; maximum dimension of integration to tolerate. Put
|
verbose |
Logical; should the function output how it goes about finding the conditional distribution? |
To compute the conditional distribution, the vine is subsetted to the selected variables if possible. Then, if the conditioned variable is a leaf, the conditional distributon is directly computed. If it's not a leaf, the conditional distribution is computed by integrating the density.
If the subsetted vine does not exist, then the vine will be subsetted "as much as possible", and the remaining variables that cannot be removed will be integrated out to find the joint density of the selected variables, from which the conditional cdf will be found.
A vector of length = the number of observations in dat
,
representing the evaluated conditional distribution of variable var
given the other variables in condset
.
If integration beyond maxint
dimensions is required to obtain
the quantities, then an error is thrown.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## D-Vine example
G <- AtoG(CopulaModel::Dvinearray(5))[1:3, ]
rv <- rvine(G, "bvncop", makeuppertri(c(1:7/10), 2, 5, byRow = FALSE))
dat <- rrvine(10, rv)
## Compute 5|1:4. There's an algorithm for that.
pcondrvine(dat, rv, var=5, verbose=T)
## Compute 5|4. pcondrvine just uses 'pcondcop()'.
pcondrvine(dat, rv, var=5, condset=4, verbose=T)
## Compute 5|2:3. Two integrals takes ~13 min if maxint > 1.
pcondrvine(dat, rv, var=5, condset=c(2,3), maxint=1, verbose=T)
## Compute 4|(1,2,3,5). No algorithm for that.
pcondrvine(dat, rv, var=4, verbose=T)
pcondrvine(dat, rv, var=4, maxint=0, verbose=T) # No int. tolerance
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.