Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The short answer is that <code>G</code> is maintained by the optimizer as part of the minimization process, while the <code>(D_neg, D, and C)</code> arguments are passed in as-is from the <code>args</code> tuple.</p> <p>By default, <code>scipy.optimize.minimize</code> takes a function <code>fun(x)</code> that accepts one argument <code>x</code> (which might be an array or the like) and returns a scalar. <code>scipy.optimize.minimize</code> then finds an argument value <code>xp</code> such that <code>fun(xp)</code> is less than <code>fun(x)</code> for other values of <code>x</code>. The optimizer is responsible for creating values of <code>x</code> and passing them to <code>fun</code> for evaluation.</p> <p>But what if you happen to have a function <code>fun(x, y)</code> that has some additional parameter <code>y</code> that needs to be passed in separately (but is considered a constant for the purposes of the optimization)? This is what the <code>args</code> tuple is for. The <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize" rel="noreferrer">documentation</a> tries to explain how the args tuple is used, but it can be a little hard to parse:</p> <blockquote> <p>args: <em>tuple, optional</em></p> <p>Extra arguments passed to the objective function and its derivatives (Jacobian, Hessian).</p> </blockquote> <p>Effectively, <code>scipy.optimize.minimize</code> will pass whatever is in <code>args</code> as the remainder of the arguments to <code>fun</code>, using the asterisk arguments notation: the function is then called as <code>fun(x, *args)</code> during optimization. The <code>x</code> portion is passed in by the optimizer, and the <code>args</code> tuple is given as the remaining arguments.</p> <p>So, in your code, the value of the <code>G</code> element is maintained by the optimizer while evaluating possible values of <code>G</code>, and the <code>(D_neg, D, C)</code> tuple is passed in as-is.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload