Vinecop.simulate_conditional

Vinecop.simulate_conditional(self, u_cond: numpy.ndarray, qrng: bool = False, num_threads: int = 1, seeds: collections.abc.Sequence[int] = []) numpy.ndarray

Simulates from the conditional distribution of a subset of variables given fixed values of the remaining variables.

The conditioning variables are the last k = u_cond.cols() variables of the vine order get_order() (they are drawn first by the vine and form a self-contained sub-vine). Each row of u_cond is one conditioning point; the corresponding output row is drawn from the remaining variables’ distribution conditional on that point. It is implemented as a Rosenblatt transform of the conditioning variables followed by an inverse Rosenblatt transform (see rosenblatt() / inverse_rosenblatt()).

Discrete conditioning variables are supported. As for the other data-taking methods, a discrete variable requires its left-limit CDF \(F(x^-)\)in addition to \(F(x)\); u_cond therefore carries one extra column per discrete conditioning variable (see the u_cond layout below). The conditioned variables are then drawn using the randomized transform of rosenblatt() (see its randomize_discrete note).

Parameters:
u_condndarray, shape (n, m), dtype float

An \(n \times (k + k_d)\)matrix of conditioning values, where k is the number of conditioning variables and k_d the number of discrete ones among them. Row j is the conditioning point for output sample j (n is u_cond.rows()). The first k columns hold the values \(F(x)\); column i corresponds to variable get_order()[d - k + i], i.e. the columns correspond, left to right, to the last k entries of get_order(). The next k_d columns hold the left-limits \(F(x^-)\)of the discrete conditioning variables, in the order those variables appear among the first k columns. For all-continuous conditioning this is simply an \(n \times k\)matrix. k is inferred from the column count; supplying only k columns when a conditioning variable is discrete may be silently reinterpreted as a different k. To draw many samples at a single conditioning point, pass that point repeated (e.g. u0.replicate(n, 1)).

qrngbool

Set to true for quasi-random numbers (over the conditioned variables).

num_threadsint

The number of threads to use for computations.

seedslist of int

Seeds of the random number generator; if empty (default), the random number generator is seeded randomly.

Returns:
ndarray, shape (n, m), dtype float

An \(n \times d\)matrix; the remaining columns are draws from the conditional distribution. The conditioning columns reproduce u_cond exactly for continuous variables. A discrete conditioning variable is reproduced up to its atom (the column lands in \([F(x^-), F(x)]\)); with several discrete conditioning variables the later-drawn ones may land slightly outside their atom, but the draws of the remaining (conditioned) variables remain correct.