title: Multivariate Non-linear minimization in R
body: <p>I need to minimize the objective function shown below, the variables in green boxes will be introduced to the formula and the variables in red boxes needed to be optimized and there will be a starting value for each. as of yet the optimization is not constrained. I put the formula here not to wait for a code but for the responses to have an idea about the function. What I've done so far: I searched the threads, I've tried the <code>nlm</code> command on a toy function:</p>
  
  <pre><code>fn =function(x,a) {sum(100*a+(2*x^2+5*x-7))}
  nlm(fn , a&lt;-c(10),x&lt;- c(100), hessian=TRUE)
  </code></pre>
  
  <p>but I couldn't get the value for the optimum (a) and I doubt that I've some errors in the formula, I am using this formula as a starting point to tackle the formula below. What I am looking for is can any one point me to the suitable function in R that I will start from.</p>
  
  <p><img src="https://i.stack.imgur.com/lN2o7.png" alt="The Obj. Function"></p>