A probabilistic framework for reference design for guaranteed fault diagnosis under closed-loop control