Inverse_BrierScoreCalc.m 795 B

12345678910111213141516171819202122232425262728293031
  1. function [ Poc_final ] = Inverse_BrierScoreCalc( BrierScore, Occured )
  2. % Given an set outcome and a set brier score, what was the probability that
  3. % the individual responded? We get it by basically doing the inverse of the
  4. % BrierScoreCalc function
  5. BS = BrierScore;
  6. b = Occured;
  7. d = 1 - Occured;
  8. a_root = 1 ;
  9. b_root = ((-2*b) - 2 + (2*d)) /2;
  10. c_root = (b^2 + 1 - (2*d) + d^2 -BS) /2;
  11. results = roots([a_root b_root c_root]);
  12. Poc = results(results>=0 & results<=1);
  13. Poc_final = Poc(1);
  14. % ProbNotOccurs = 1 - ProbOccurs;
  15. % Outcome_Y = Occured;
  16. % Outcome_N = 1-Outcome_Y;
  17. %
  18. % Poc = (Outcome_Y^2 - Outcome_N^2 - BrierScore + 1 - (2*Outcome_N)) / ((2*Outcome_Y) - 2 - (2*Outcome_N));
  19. % BS = (ProbOccurs - Occured)^2 + (ProbNotOccurs - (1-Occured) )^2;
  20. end