title: Forcing nls to fit a curve passing through a specified point
body: <p>I'm trying to fit a Boltzmann sigmoid <code>1/(1+exp((x-p1)/p2))</code> to this small experimental dataset:</p>
  
  <pre><code>xdata &lt;- c(-60,-50,-40,-30,-20,-10,-0,10)
  ydata &lt;- c(0.04, 0.09, 0.38, 0.63, 0.79, 1, 0.83, 0.56)
  </code></pre>
  
  <p>I know that it is pretty simple to do it. For example, using <code>nls</code>:</p>
  
  <pre><code>fit &lt;-nls(ydata ~ 1/(1+exp((xdata-p1)/p2)),start=list(p1=mean(xdata),p2=-5))
  </code></pre>
  
  <p>I get the following results:</p>
  
  <pre><code>Formula: ydata ~ 1/(1 + exp((xdata - p1)/p2))
  
  Parameters:
     Estimate Std. Error t value Pr(&gt;|t|)    
  p1  -33.671      4.755  -7.081 0.000398 ***
  p2  -10.336      4.312  -2.397 0.053490 .  
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  
  Residual standard error: 0.1904 on 6 degrees of freedom
  
  Number of iterations to convergence: 13 
  Achieved convergence tolerance: 7.079e-06
  </code></pre>
  
  <p>However, I <strong>need</strong> (due to theoretical reasons) the fitted curve to pass precisely through the point <code>(-70, 0)</code>. Although the value of the fitted expression showed above passes near zero at <code>x = -70</code>, it is not exactly zero, which is not what I want.</p>
  
  <p>So, the question is: Is there a way to tell <code>nls</code> (or some other function) to fit the same expression but forcing it to pass through a specified point?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>As it has been mentioned in the comments, it is mathematically impossible to force the fit to go through the point (-70,0) using the function I provided (the Boltzmann sigmoid). On the other hand, @Cleb and @BenBolker have explained how to force the fit to go through any other point, for instance (-50, 0.09). </p>