x | P(x), of empirical_dist object x.R/empirical_dist.R
conditional.empirical_dist.RdIn other words, we condition the data on the predicate function. In order to do so, we simply remove all rows from the data that do not satisfy the predicate P. For instance, if we have a 2-dimensional distribution, and we want to condition on the first dimension being greater than the second dimension, we would do the following:
# S3 method for class 'empirical_dist'
conditional(x, P, ...)x_cond <- conditional(x, function(d) d[1] > d[2])This would return a new empirical distribution object with the same
dimensionality as x, but with all rows where the first dimension is
less than or equal to the second dimension removed.