Reduced-rank approximations to spectroscopic and compositional data: A universal framework based on log-ratios and counting statistics