Statistical inference for inverse problems