Local reliability weighting predicts trial-by-trial responses in a natural detection task