title: Using R's nls, how to define the coefficients' individual formulae / constraints?
body: <p>I've got a model to be estimated through the non-linear least squares method. The model is specified in such a way that I have a main formula having 5 coefficients which in turn have their own formulas dependent on total of four coefficients. The first formula itself is linear, it is the inclusion of the coefficients' individual formulae that makes the model nonlinear.</p>
  
  <p>The R's nls function asks for a formula without the coefficients. I have no idea how to define them then.</p>
  
  <p>To make things crystal clear, I'll post the concrete formulas below. I'll use '_' for index and "{}" brackets for the content of such index if it involves any algebra. Syntax is very much TEX-like, variable names are just single characters, so I didn't bother placing "*" everywhere where multiplication occurs.</p>
  
  <pre><code>p_t = β_1p_{t-1} + β_2p_{t-2} + β_3d_{t-1} + β_4d_{t-2} + β_5d_{t-3} + γ
  
  β_1 = 2 - b - c 
  β_2 = -(1-c)(1-b) 
  β_3 = cδ + bα 
  β_4 = -cδ(1-b) - bα(2-c) 
  β_5 = bα(1-c) 
  </code></pre>