title: About the definition or algorithm of the "value" component in the output of solve.qp in quadprog, R
body: <p>I am using <code>solve.QP</code> in <code>quadprog</code> package of R to solve the classical mean-variance optimization problem. In my understanding, the output component "value" means the variance of the optimized portfolio and many codes for the mean-variance optimization posted online also show that <code>sqrt(sol$value)</code> is the standard deviation of the optimized portfolio.</p>
  
  <p>However, when I use <code>solve.QP</code> to solve a simple mean-variance optimization, <code>sol$value</code> provides me a negative value which is also different from the value calculated by using the portfolio variance function: <code>w%*%covariance%*%t(w)</code>. I was trying to search online for the definition or the algorithm for <code>sol$value</code> but unfortunately I could not find detailed description. The R Documentation for <code>quadprog</code> only states that "value" is "scalar, the value of the quadratic function at the solution".</p>
  
  <p>So could anyone who is familiar with <code>solve.QP</code> could tell me the exact definition or algorithm of <code>sol$value</code>. And if my understanding about it is correct, namely the variance of the optimized portfolio, then what is the possible reason that <code>solve.QP</code> provides me negative values for <code>sol$value</code>.</p>