<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 4:38 PM, Joe Kington <span dir="ltr"><<a href="mailto:joferkington@gmail.com" target="_blank">joferkington@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">They're relatively recent additions, but numpy.polynomial.polyvander2d and numpy.polynomial.polyval2d should also do what you want, unless I'm misunderstanding the problem.<div><br></div><div><a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.polynomial.polynomial.polyvander2d.html#numpy.polynomial.polynomial.polyvander2d" target="_blank">https://docs.scipy.org/doc/<wbr>numpy/reference/generated/<wbr>numpy.polynomial.polynomial.<wbr>polyvander2d.html#numpy.<wbr>polynomial.polynomial.<wbr>polyvander2d</a><br></div><div><a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.polynomial.polynomial.polyval2d.html#numpy.polynomial.polynomial.polyval2d" target="_blank">https://docs.scipy.org/doc/<wbr>numpy/reference/generated/<wbr>numpy.polynomial.polynomial.<wbr>polyval2d.html#numpy.<wbr>polynomial.polynomial.<wbr>polyval2d</a><br></div><div><br></div><div>You can also do things like (you could generalize this to N-dimensions, as well):</div><div><br></div><div><pre class="m_-3665969728674419192gmail-lang-py m_-3665969728674419192gmail-prettyprint m_-3665969728674419192gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> polyfit2d</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">x</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> y</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> z</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> order</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">3</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ncols </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">order </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">+</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)**</span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">2</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
G </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> np</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">zeros</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">((</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">x</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">size</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> ncols</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ij </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> itertools</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">product</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">range</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">order</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">+</span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)"><wbr>1</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">),</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> range</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">order</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">+</span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">for</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> k</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">i</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">j</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">in</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> enumerate</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">ij</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
G</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">[:,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">k</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">]</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> x</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">**</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">i </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">*</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> y</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">**</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">j
m</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> _</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> _</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> _ </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> np</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">linalg</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">lstsq</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">G</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> z</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> m
</span><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">def</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> polyval2d</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">x</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> y</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> m</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
order </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> int</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">np</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">sqrt</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">len</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">m</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)))</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">-</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
ij </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> itertools</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">product</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">range</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">order</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">+</span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)"><wbr>1</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">),</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> range</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">order</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">+</span><span class="m_-3665969728674419192gmail-lit" style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
z </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> np</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">zeros_like</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">x</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">for</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> a</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">i</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">j</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">in</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> zip</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">m</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> ij</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">):</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
z </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">+=</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> a </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">*</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> x</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">**</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">i </span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">*</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> y</span><span class="m_-3665969728674419192gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">**</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">j
</span><span class="m_-3665969728674419192gmail-kwd" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">return</span><span class="m_-3665969728674419192gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> z</span></code></pre></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br></div></div></div></blockquote><div><br></div><div>I think the "bilinear" is a mistake, as bilinear usually means terms of degree two. AFAICT, this question is just about multivariate linear fits only<br><br></div><div><snip><br><br></div><div>Chuck <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br></blockquote></div><br></div></div>