title: R optimization with fixed sum of parameters
body: <p>i want to optimize one function, with the sum of parameters set to 1
  here there is the function</p>
  
  <pre><code>varxyz&lt;-function(param){
  a&lt;-param[1]
  b&lt;-param[2]
  c&lt;-param[3]
  a^2*matcov[1,1]+b^2*matcov[2,2]+c^2*matcov[3,3]+2*a*b*matcov[1,2]+2*a*c*matcov[1,3]+2*b*c*matcov[2,3]   
  }  
  
  
  parammv &lt;- optim(c(0.3,0.3,0.4),varxyz,method="L-BFGS-B",lower=c(0.1,0.1,0.1))
  </code></pre>
  
  <p>where matcov is the covariance matrix</p>
  
  <p>How can I set the sum of the three parameters to 1?
  Thanks for answers</p>