title: Inverse function in R
body: <p>So I have a function: <code>f(a,b,rho)=r</code>. Given <code>a</code>,<code>b</code> and <code>r</code>, I would like to find <code>rho</code>. I came across the inverse function in R, but it seems that when the function tries to find <code>rho</code>, the function cannot tell which of <code>a</code>, <code>b</code> or <code>rho</code> is the specified <code>rho</code> and also the function cannot load the given <code>a</code> and <code>b</code>. In addition, I know that <code>rho</code> will be between 0 and 1.</p>
  
  <pre><code>a = -.7
  b = 2
  r &lt;- function(rho,a,b){
              # basically here I defined a very long function of r 
              # in terms of a and b and rho
       }
  
  R_inverse=inverse(function(rho) r(rho,-.7,2),0,1)
  
  # r_value is just a random value
  R_inverse(r_value)
  </code></pre>
  
  <p>This does not work. I would appreciate any help with the inverse function or any other alternative way to find <code>rho</code> given <code>r</code> and <code>a</code> and <code>b</code>. </p>