<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to solve least squares problem? For dummies. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-solve-least-squares-problem-For-dummies/m-p/837926#M6223</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm trying to solve least squares problem. Given matrix A(mxn), m &amp;gt; n, minimize (Ax - b)&lt;SUP&gt;2&lt;/SUP&gt;. MKL Reference suggests to use &lt;A href="http://software.intel.com/sites/products/documentation/hpc/mkl/mklman/hh_goto.htm#lse/lse_crofactor.htm" name="qrfactor"&gt;&lt;/A&gt;&lt;A href="http://software.intel.com/sites/products/documentation/hpc/mkl/mklman/hh_goto.htm#lse/lse_crofactor.htm"&gt;QR Factorization&lt;/A&gt;. And all calculation is done in several steps - factorization itself, normalizing matrix form, multiplying rhs, etc.&lt;BR /&gt;&lt;BR /&gt;However, its a little complicated and I found no straightforward explanation on how to compute result x from given A and b. For now I don't even sure how to acquire matrix R. Should I manually multiply A with Q&lt;SUP&gt;T&lt;/SUP&gt;? Or should I extract it somehow from QR result?&lt;BR /&gt;&lt;BR /&gt;I think it'd be pretty convenient to provide manual with simple code example of function&lt;BR /&gt;&lt;BR /&gt;SolveLSP(int m, int n, float* A, float* b, float* x);&lt;BR /&gt;&lt;BR /&gt;using LAPACKE_sgeqrf(), LAPACKE_sorgqr() etc. calls, which is exactly my problem. One may assume matrix_order to be LAPACK_ROW_MAJOR.&lt;BR /&gt;&lt;BR /&gt;E.g. &lt;A href="http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/ippxe/ipp_manual_lnx/hh_goto.htm#IPPM/ippm_ch7/functn_QRDecomp.htm"&gt;ippmQRDecomp&lt;/A&gt; reference is great. Even with picture and enough explanation on storage, though one should not be concerned of it granted with simple &lt;A href="http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/ippxe/ipp_manual_lnx/hh_goto.htm#IPPM/ippm_ch7/functn_QRBackSubst.htm"&gt;ippmQRBackSubst&lt;/A&gt; function. &lt;BR /&gt;&lt;BR /&gt;Would you please grant me with such example or with some simple explanation of what functions should I call in what order?&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;</description>
    <pubDate>Fri, 15 Apr 2011 10:42:11 GMT</pubDate>
    <dc:creator>Mikhail_Matrosov</dc:creator>
    <dc:date>2011-04-15T10:42:11Z</dc:date>
    <item>
      <title>How to solve least squares problem? For dummies.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-solve-least-squares-problem-For-dummies/m-p/837926#M6223</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm trying to solve least squares problem. Given matrix A(mxn), m &amp;gt; n, minimize (Ax - b)&lt;SUP&gt;2&lt;/SUP&gt;. MKL Reference suggests to use &lt;A href="http://software.intel.com/sites/products/documentation/hpc/mkl/mklman/hh_goto.htm#lse/lse_crofactor.htm" name="qrfactor"&gt;&lt;/A&gt;&lt;A href="http://software.intel.com/sites/products/documentation/hpc/mkl/mklman/hh_goto.htm#lse/lse_crofactor.htm"&gt;QR Factorization&lt;/A&gt;. And all calculation is done in several steps - factorization itself, normalizing matrix form, multiplying rhs, etc.&lt;BR /&gt;&lt;BR /&gt;However, its a little complicated and I found no straightforward explanation on how to compute result x from given A and b. For now I don't even sure how to acquire matrix R. Should I manually multiply A with Q&lt;SUP&gt;T&lt;/SUP&gt;? Or should I extract it somehow from QR result?&lt;BR /&gt;&lt;BR /&gt;I think it'd be pretty convenient to provide manual with simple code example of function&lt;BR /&gt;&lt;BR /&gt;SolveLSP(int m, int n, float* A, float* b, float* x);&lt;BR /&gt;&lt;BR /&gt;using LAPACKE_sgeqrf(), LAPACKE_sorgqr() etc. calls, which is exactly my problem. One may assume matrix_order to be LAPACK_ROW_MAJOR.&lt;BR /&gt;&lt;BR /&gt;E.g. &lt;A href="http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/ippxe/ipp_manual_lnx/hh_goto.htm#IPPM/ippm_ch7/functn_QRDecomp.htm"&gt;ippmQRDecomp&lt;/A&gt; reference is great. Even with picture and enough explanation on storage, though one should not be concerned of it granted with simple &lt;A href="http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/ippxe/ipp_manual_lnx/hh_goto.htm#IPPM/ippm_ch7/functn_QRBackSubst.htm"&gt;ippmQRBackSubst&lt;/A&gt; function. &lt;BR /&gt;&lt;BR /&gt;Would you please grant me with such example or with some simple explanation of what functions should I call in what order?&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Apr 2011 10:42:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-solve-least-squares-problem-For-dummies/m-p/837926#M6223</guid>
      <dc:creator>Mikhail_Matrosov</dc:creator>
      <dc:date>2011-04-15T10:42:11Z</dc:date>
    </item>
    <item>
      <title>How to solve least squares problem? For dummies.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-solve-least-squares-problem-For-dummies/m-p/837927#M6224</link>
      <description>If you are interested only in obtaining a least-squares solution rather than in the intermediate results such as Q and R, please look at the LAPACKE_?gels routines, and the several examples in the ../mkl/examples/lapacke/source directory.</description>
      <pubDate>Fri, 15 Apr 2011 13:24:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-solve-least-squares-problem-For-dummies/m-p/837927#M6224</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-04-15T13:24:46Z</dc:date>
    </item>
    <item>
      <title>How to solve least squares problem? For dummies.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-solve-least-squares-problem-For-dummies/m-p/837928#M6225</link>
      <description>This is the best answer I didn't even dare to hear :) &lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Fri, 15 Apr 2011 13:41:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-solve-least-squares-problem-For-dummies/m-p/837928#M6225</guid>
      <dc:creator>Mikhail_Matrosov</dc:creator>
      <dc:date>2011-04-15T13:41:32Z</dc:date>
    </item>
  </channel>
</rss>

