title: How to fit model to data without noise (perfect fit) in R?
body: <p>If I have the following dataset:</p>
  
  <pre><code>df = data.frame(x = 1:10, y = 3 + 4 * exp(x = 1:10))
  </code></pre>
  
  <p>And I try to fit a <code>nls</code> model:</p>
  
  <pre><code>nls(y ~ a + b * exp(x), data = df, start = list(a = 3.4, b = 4.1))
  </code></pre>
  
  <p>I get an error because this is a perfect fit and <code>nls</code> can't work with noiseless data (as shown in the function's examples). Is there an alternative function I can use that will find the parameters when a perfect fit is present?</p>
  
  <p>Right now, all I know to do is put the data in Excel and create a "Chart" and show the trendline! I'd much rather do this straight in R.</p>
  
  <p>Seems like a simple solution is possible, but I've searched around and haven't seen a solution yet.</p>