  The design of optimal test statistics is a key task in frequentist statistics
and for a number of scenarios optimal test statistics such as the
profile-likelihood ratio are known. By turning this argument around we can find
the profile likelihood ratio even in likelihood-free cases, where only samples
from a simulator are available, by optimizing a test statistic within those
scenarios. We propose a likelihood-free training algorithm that produces test
statistics that are equivalent to the profile likelihood ratios in cases where
the latter is known to be optimal.
