Optimisation on hybrid spaces and its application to statistical inference