<p>I tried to do the math and got stuck. I asked for <a href="https://math.stackexchange.com/questions/2988734/erf-function-and-solving-for-two-unknowns">help at math.se</a> and didn't get any further. My thinking is that it is not possible to write down a nice simple answer even though it is two equations and two unknowns, since system is not linear. When faced with math I cannot do, sometimes it is easier to just bring out the MATLAB hammer:</p>

<pre><code>function [HR, FAR] = findHRFAR(c, acc)
    ACC = @(HR, FAR)(HR+1-FAR)./2;
    C = @(HR, FAR)(norminv(HR)+norminv(FAR))./2;

    HR = fminbnd(@(HR)temp(HR, c, acc), 0, 1);
    [SSE, FAR] = temp(HR, c, acc);

    [HR, FAR, C(HR, FAR), ACC(HR, FAR), SSE]

    function [SSE, FAR] = temp(HR, c, acc)
        [FAR, SSE] = fminbnd(@(FAR)((c-C(HR, FAR)).^2)+...
            ((acc-ACC(HR, FAR)).^2), 0, 1);
    end
end
</code></pre>

<p>It runs pretty fast, but ... the nested bounded optimization is ugly, and there may be a more efficient way to find the answer. I also don't see any reason this could not be done in Octave, Python, or any similar type program of your choice. </p>

CC BY-SA 4.0
2019-02-21T22:15:30.680Z
2019-02-21T22:15:30.680Z
StrongBad
<p>Lets say I have an equal variance SDT framework with an equal number of target present and target absent trials:</p>

<p><span class="math-container">$d'=Z^{-1}(HR)-Z^{-1}(FAR)$</span></p>

<p><span class="math-container">$C=\frac{Z^{-1}(HR)+Z^{-1}(FAR)}{-2}$</span></p>

<p><span class="math-container">$ACC=\frac{HR+(1-FAR)}{2}$</span></p>

<p>where <span class="math-container">$HR=$</span> hit rate, <span class="math-container">$FAR=$</span> false alarm rate, <span class="math-container">$d'=$</span> sensitivity, <span class="math-container">$C=$</span> bias, and <span class="math-container">$ACC=$</span> accuracy.</p>

<p>If I know the value of <span class="math-container">$C$</span> and <span class="math-container">$ACC$</span>, how do I solve for <span class="math-container">$HR$</span> and <span class="math-container">$FAR$</span>?</p>

<p>To put it another way. In ROC space, I know my iso-bias curve and I know my iso-accuracy curve, and I want to know the coordinates where they intersect in terms of <span class="math-container">$HR$</span> and <span class="math-container">$FAR$</span>.</p>

<p>It seems that I should take my equations for <span class="math-container">$C$</span> and <span class="math-container">$ACC$</span> in terms of <span class="math-container">$HR$</span> and <span class="math-container">$FAR$</span>, and work them to give me <span class="math-container">$HR$</span> and <span class="math-container">$FAR$</span> in terms of <span class="math-container">$C$</span> and <span class="math-container">$ACC$</span>, but I haven't managed to successfully untangle the inverse CDFs in order to do that.</p>

<p><strong>Edit:</strong></p>

<p>I can rearrange the equation for <span class="math-container">$ACC$</span>, to express <span class="math-container">$FAR$</span> in terms of <span class="math-container">$HR$</span> and <span class="math-container">$ACC$</span>:</p>

<p><span class="math-container">$FAR=HR+1-2ACC$</span></p>

<p>And then I can plug that into the equation for <span class="math-container">$C$</span>:</p>

<p><span class="math-container">$C=\frac{Z^{-1}(HR)+Z^{-1}(HR+1-2ACC)}{-2}$</span></p>

<p>And rearrange that a bit:</p>

<p><span class="math-container">$Z^{-1}(HR)=-2C-Z^{-1}(HR+1-2ACC)$</span></p>

<p>And then I could do this:</p>

<p><span class="math-container">$HR=Z(-2C-Z^{-1}(HR+1-2ACC))$</span></p>

<p>And then I get stuck, because I'm not sure how to "free" the <span class="math-container">$HR$</span> buried on the right-hand side.</p>

CC BY-SA 4.0
2018-11-04T01:11:07.567Z
Welcome to Psychology.SE.  Although the subject of the equations may fit the scope of this site, I am wondering if this may be more suited to https://math.stackexchange.com  Whether it is better suited here or at https://math.stackexchange.com,  what have you done to try and solve this and what are the results of your attempts?  Where are your specific difficulties in solving in relation to "untangling the inverse CDFs"?
Chris Rogers
CC BY-SA 4.0
2018-11-04T19:40:54.387Z
I was wondering the same thing. If treated purely as a system of equations to solve, then math.stackexchange seems more appropriate. But, I thought that perhaps there might be a different conceptual approach to the problem, which an SDT expert might know of, which is why I included the explanation in terms of ROC space. In any case, I've added my progress (or lack thereof) in solving the equations, as you requested. I am happy to move (repost?) it to math.stackexchange if you prefer.
adamk
CC BY-SA 4.0
2018-11-04T20:42:36.053Z
Although I'm in psychophysics, there's basically just one person that can help out here - StrongBad. They are not too active here, but they do seem to keep track of questions marked with the *'Psychophysics'* tag, which is now included. They are knowledgeable on the topic and let's wait a bit until they show up. Otherwise, Math is surely another option. Please do not cross-post, but let the mod team migrate the question instead.
AliceD
CC BY-SA 4.0
2018-11-06T18:24:06.453Z
@AliceD I am not sure if there is an analytical expression unless you want to approximate the Gaussian CDF. If I am the best hope, then it is probably best to ask over at math.se, but if the OP can phrase the question in terms of the underlying integrals, that is probably better.
StrongBad
CC BY-SA 4.0
2018-11-06T18:25:57.293Z
@AliceD I suggest keeping this question here, asking the underlying mathematical question there, and then posting an answer here from the gained knowledge. The current formulation of the question is really nice for cogsci.se.
StrongBad
CC BY-SA 4.0
2018-11-06T20:56:54.750Z
@StrongBad - glad you came over. I'm totally fine leaving it here, but I'm afraid it will remain answerless.
AliceD
CC BY-SA 4.0
2018-11-06T20:59:22.107Z
@AliceD If it gets an answer over at math.se, than we/I/someone can translate from math speak to psych speak.
StrongBad
CC BY-SA 4.0
2018-11-07T16:25:26.813Z
I asked a related question over at math.se: https://math.stackexchange.com/questions/2988734/erf-function-and-solving-for-two-unknowns depending on your level of math, it might provide helpful insight.
StrongBad
<psychophysics><signal-detection>
Solving for HR and FAR, given ACC and C
adamk
# Solving for HR and FAR, given ACC and C

(Asked by: username_0 on 2018-11-03)

Lets say I have an equal variance SDT framework with an equal number of target present and target absent trials:

$d'=Z^{-1}(HR)-Z^{-1}(FAR)$

$C=\frac{Z^{-1}(HR)+Z^{-1}(FAR)}{-2}$

$ACC=\frac{HR+(1-FAR)}{2}$

where $HR=$ hit rate, $FAR=$ false alarm rate, $d'=$ sensitivity, $C=$ bias, and $ACC=$ accuracy.

If I know the value of $C$ and $ACC$, how do I solve for $HR$ and $FAR$?

To put it another way. In ROC space, I know my iso-bias curve and I know my iso-accuracy curve, and I want to know the coordinates where they intersect in terms of $HR$ and $FAR$.

It seems that I should take my equations for $C$ and $ACC$ in terms of $HR$ and $FAR$, and work them to give me $HR$ and $FAR$ in terms of $C$ and $ACC$, but I haven't managed to successfully untangle the inverse CDFs in order to do that.

**Edit:**

I can rearrange the equation for $ACC$, to express $FAR$ in terms of $HR$ and $ACC$:

$FAR=HR+1-2ACC$

And then I can plug that into the equation for $C$:

$C=\frac{Z^{-1}(HR)+Z^{-1}(HR+1-2ACC)}{-2}$

And rearrange that a bit:

$Z^{-1}(HR)=-2C-Z^{-1}(HR+1-2ACC)$

And then I could do this:

$HR=Z(-2C-Z^{-1}(HR+1-2ACC))$

And then I get stuck, because I'm not sure how to "free" the $HR$ buried on the right-hand side.

**Tags:** psychophysics, signal-detection

> **Comments:**
> **username_1**: Welcome to Psychology.SE.  Although the subject of the equations may fit the scope of this site, I am wondering if this may be more suited to https://math.stackexchange.com  Whether it is better suited here or at https://math.stackexchange.com,  what have you done to try and solve this and what are the results of your attempts?  Where are your specific difficulties in solving in relation to "untangling the inverse CDFs"?  
> **username_0**: I was wondering the same thing. If treated purely as a system of equations to solve, then math.stackexchange seems more appropriate. But, I thought that perhaps there might be a different conceptual approach to the problem, which an SDT expert might know of, which is why I included the explanation in terms of ROC space. In any case, I've added my progress (or lack thereof) in solving the equations, as you requested. I am happy to move (repost?) it to math.stackexchange if you prefer.  
> **username_2**: Although I'm in psychophysics, there's basically just one person that can help out here - username_3. They are not too active here, but they do seem to keep track of questions marked with the *'Psychophysics'* tag, which is now included. They are knowledgeable on the topic and let's wait a bit until they show up. Otherwise, Math is surely another option. Please do not cross-post, but let the mod team migrate the question instead.  
> **username_3**: @username_2 I am not sure if there is an analytical expression unless you want to approximate the Gaussian CDF. If I am the best hope, then it is probably best to ask over at math.se, but if the OP can phrase the question in terms of the underlying integrals, that is probably better.  
> **username_3**: @username_2 I suggest keeping this question here, asking the underlying mathematical question there, and then posting an answer here from the gained knowledge. The current formulation of the question is really nice for cogsci.se.  
> **username_2**: @username_3 - glad you came over. I'm totally fine leaving it here, but I'm afraid it will remain answerless.  
> **username_3**: @username_2 If it gets an answer over at math.se, than we/I/someone can translate from math speak to psych speak.  
> **username_3**: I asked a related question over at math.se: https://math.stackexchange.com/questions/2988734/erf-function-and-solving-for-two-unknowns depending on your level of math, it might provide helpful insight.  

---

## 1 answers

### Answer by username_3 on 2019-02-21. Score: 1

I tried to do the math and got stuck. I asked for help at math.se and didn't get any further. My thinking is that it is not possible to write down a nice simple answer even though it is two equations and two unknowns, since system is not linear. When faced with math I cannot do, sometimes it is easier to just bring out the MATLAB hammer:
function [HR, FAR] = findHRFAR(c, acc)
    ACC = @(HR, FAR)(HR+1-FAR)./2;
    C = @(HR, FAR)(norminv(HR)+norminv(FAR))./2;

    HR = fminbnd(@(HR)temp(HR, c, acc), 0, 1);
    [SSE, FAR] = temp(HR, c, acc);

    [HR, FAR, C(HR, FAR), ACC(HR, FAR), SSE]

    function [SSE, FAR] = temp(HR, c, acc)
        [FAR, SSE] = fminbnd(@(FAR)((c-C(HR, FAR)).^2)+...
            ((acc-ACC(HR, FAR)).^2), 0, 1);
    end
end

It runs pretty fast, but ... the nested bounded optimization is ugly, and there may be a more efficient way to find the answer. I also don't see any reason this could not be done in Octave, Python, or any similar type program of your choice.


---

