While adopt also allows implementation of custom scores via subclassing, for most applications a simple point-wise arithmetic on scores is sufficient. For instance, consider the case of a utility maximizing approach to planning where not a hard constraint on power but rather a trade-off betweem power and expected sample size is required. The simplest utility function would just be a weightes sum of both power (negative weight since we minimize costs!) and expected sample size.
Consider the following situation
Adoptr supports such
CompositeScores via the
The new unconditional score can be evaluated as usual, e.g.
Note that conditional and unconditional scores cannot be mixed in an expression passed to
composite. Composite conditional score, however, are possible as well.
Of course, composite conditional scores can also be integrated
and (due to linearity) the result is exactly the same as before.
Composite scores are not restricted to linear operations but support any valid numerical expression:
Even control flow is supported:
The only real constraint is that the expression must be vectorized.