  In certain cases of astronomical data analysis, the meaningful physical
quantity to extract is the ratio $R$ between two data sets. Examples include
the lensing ratio, the interloper rate in spectroscopic redshift samples, the
decay rate of gravitational potential and $E_G$ to test gravity. However,
simply taking the ratio of the two data sets is biased, since it renders (even
statistical) errors in the denominator into systematic errors in $R$.
Furthermore, it is not optimal in minimizing statistical errors of $R$. Based
on Bayesian analysis and the usual assumption of Gaussian error in the data, we
derive an analytical expression of the posterior PDF $P(R)$. This result
enables fast and unbiased $R$ measurement, with minimal statistical errors.
Furthermore, it relies on no underlying model other than the proportionality
relation between the two data sets. Even more generally, it applies to the
cases where the proportionality relation holds for the underlying
physics/statistics instead of the two data sets directly. It also applies to
the case of multiple ratios ($R\rightarrow {\bf R}=(R_1,R_2,\cdots)$). We take
the lensing ratio as an example to demonstrate our method. We take lenses as
DESI imaging survey galaxies, and sources as DECaLS cosmic shear and
\emph{Planck} CMB lensing. We restrict the analysis to the ratio between CMB
lensing and cosmic shear. The resulting $P(R)$, for multiple lens-shear pairs,
are all nearly Gaussian. The S/N of measured $R$ ranges from $4.9$ to $8.4$. We
perform several tests to verify the robustness of the above result.
