Optimized confidence weights for localization algorithms with scarce information