12345678910111213141516171819202122232425262728293031 |
- function [ Poc_final ] = Inverse_BrierScoreCalc( BrierScore, Occured )
- % Given an set outcome and a set brier score, what was the probability that
- % the individual responded? We get it by basically doing the inverse of the
- % BrierScoreCalc function
- BS = BrierScore;
- b = Occured;
- d = 1 - Occured;
- a_root = 1 ;
- b_root = ((-2*b) - 2 + (2*d)) /2;
- c_root = (b^2 + 1 - (2*d) + d^2 -BS) /2;
- results = roots([a_root b_root c_root]);
- Poc = results(results>=0 & results<=1);
- Poc_final = Poc(1);
- % ProbNotOccurs = 1 - ProbOccurs;
- % Outcome_Y = Occured;
- % Outcome_N = 1-Outcome_Y;
- %
- % Poc = (Outcome_Y^2 - Outcome_N^2 - BrierScore + 1 - (2*Outcome_N)) / ((2*Outcome_Y) - 2 - (2*Outcome_N));
- % BS = (ProbOccurs - Occured)^2 + (ProbNotOccurs - (1-Occured) )^2;
- end
|