\(X(x) = P(x)\). A likelihood ratio is then a quotient of two
of these: likelihood(Q) / likelihood(P_star).
Usage
likelihood(dist, label = NULL)
Arguments
- dist
A distribution.
- label
How to name it when printing. NULL describes the
distribution, e.g. P[theta = (0.5, 0.5)] or P[mixed over 3 atoms];
pass a short name such as "Q" when printing ratios.
Examples
fam <- gaussian_family(d = 2)
Q <- likelihood(mixture(fam, dirac(c(0.5, 0.5))))
Q
#> <random_variable> P[theta = (0.5, 0.5)]
#> on real_region, dimension 2
Q(c(2, 2))
#> [1] 0.01677481
likelihood(fam(c(0.5, 0.5)), label = "Q")
#> <random_variable> Q
#> on real_region, dimension 2