Skip to content

Commit

Permalink
fix error in docs on new features for Sum of Squares expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlizeng committed Nov 17, 2014
1 parent c226bea commit cf9dc96
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/julia_tutorial.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/_sources/julia_tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ assuming ``x`` has been populated with a value:
Often you'll find it useful to first initialize a sum of squares expression
to ``0`` and then add on more sum of squares expressions in a for loop.

.. code-block::none
.. code-block:: none

error_term = 0
for i in 1:3
Expand Down
6 changes: 6 additions & 0 deletions docs/_build/html/julia_tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ <h2>Sum of Squares Expressions<a class="headerlink" href="#sum-of-squares-expres
</div>
<p>Often you&#8217;ll find it useful to first initialize a sum of squares expression
to <tt class="docutils literal"><span class="pre">0</span></tt> and then add on more sum of squares expressions in a for loop.</p>
<div class="highlight-none"><div class="highlight"><pre>error_term = 0
for i in 1:3
error_term += rand() * sum_squares(A[i, :] * x + b[i])
end
</pre></div>
</div>
<p>The variance of the entries of an affine expression <tt class="docutils literal"><span class="pre">X</span></tt> can be expressed as
<tt class="docutils literal"><span class="pre">sum_squares(mean(X)</span> <span class="pre">-</span> <span class="pre">X)</span> <span class="pre">/</span> <span class="pre">(m</span> <span class="pre">*</span> <span class="pre">n)</span></tt>, where <tt class="docutils literal"><span class="pre">m</span></tt> and <tt class="docutils literal"><span class="pre">n</span></tt> are the number of rows
and number of columns of <tt class="docutils literal"><span class="pre">X</span></tt>, respectively. For convenience, the function <tt class="docutils literal"><span class="pre">var</span></tt>
Expand Down

0 comments on commit cf9dc96

Please sign in to comment.