This function calculates a posterior probability or probability density. It does so in a way that is inefficient but different from Pr() and with clearer code. It can therefore be used to test the correct functioning of Pr(). Note that, unlike Pr(), this function does not do consistency checks of its arguments.
Arguments
- Y
named list of values; list names must be valid variate names.
- X
named list of values; list names must be valid variate names.
- learnt
Either a character with the name of a directory or full path for a 'learnt.rds' object, produced by the
learn()function, or such an object itself.- tails
Named vector or list, or
NULL(default). The names must match some or all of the variates in argumentsYandX. For variates in this list, the probability arguments are understood in a semi-open interval sense: \(Y \le y\) or \(Y \ge y\), an so on. This is true forYandXvariates (on the left and on the right of the conditional sign \(\,\vert\,\)). A left-open interval \(Y \le y\) is indicated by'<='or'left'or-1; a right-open interval \(Y \ge y\) is indicated by'>='or'right'or+1. ValuesNULL,'==',0indicate that a point valueY = y(not an interval) should be calculated. NB: the semi-open intervals always include the given value; this is important for ordinal or rounded variates. For instance, if \(Y\) is an integer variate, then to calculate \(\mathrm{Pr}(Y < 3)\) you should require \(\mathrm{Pr}(Y \le 2)\); for this reason we also have that \(\mathrm{Pr}(Y \le 2)\) and \(\mathrm{Pr}(Y \ge 2)\) generally add up to more than 1.