The effect of the halide anion on the optical properties of lead halide perovskites