<?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 The interpolating polynomial in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172798#M28701</link>
    <description>&lt;P&gt;The interpolating polynomial can be obtained in the Lagrange form explicitly, without any matrix algebra. See&amp;nbsp;https://en.wikipedia.org/wiki/Lagrange_polynomial .&lt;/P&gt;&lt;P&gt;If the coefficients are desired, rather than interpolants, you may use the Lapack routine ?GESV, which is available in MKL.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2019 10:51:23 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2019-03-22T10:51:23Z</dc:date>
    <item>
      <title>MKL - General Polynomial Fitting function?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172795#M28698</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I’m looking for a general Polynomial Fitting function in &lt;STRONG&gt;MKL&lt;/STRONG&gt;, which is similar to &lt;STRONG&gt;Polyfit &lt;/STRONG&gt;function from &lt;STRONG&gt;Matlab&lt;/STRONG&gt;, &lt;STRONG&gt;OptiVec &lt;/STRONG&gt;and &lt;STRONG&gt;Armadillo&lt;/STRONG&gt;.&amp;nbsp; This function uses two set of input data X and Y to determine the coefficients&amp;nbsp;a&lt;SUB&gt;i&lt;/SUB&gt;&amp;nbsp;of a polynomial:&lt;/P&gt;&lt;P&gt;P&lt;SUB&gt;i&amp;nbsp;&lt;/SUB&gt;= a&lt;SUB&gt;0&lt;/SUB&gt;&amp;nbsp;+ a&lt;SUB&gt;1&lt;/SUB&gt;X&lt;SUB&gt;i&lt;/SUB&gt;&amp;nbsp;+ a&lt;SUB&gt;2&lt;/SUB&gt;X&lt;SUB&gt;i&lt;/SUB&gt;&lt;SUP&gt;2&lt;/SUP&gt;&amp;nbsp;... a&lt;SUB&gt;n&lt;/SUB&gt;X&lt;SUB&gt;i&lt;/SUB&gt;&lt;SUP&gt;n&lt;/SUP&gt;&lt;/P&gt;&lt;P&gt;Where,&lt;/P&gt;&lt;P&gt;χ&lt;SUP&gt;2&lt;/SUP&gt;&amp;nbsp;= sum( 1/σ&lt;SUB&gt;i&lt;/SUB&gt;&lt;SUP&gt;2&lt;/SUP&gt;&amp;nbsp;*&amp;nbsp;(P&lt;SUB&gt;i&lt;/SUB&gt;&amp;nbsp;- Y&lt;SUB&gt;i&lt;/SUB&gt;)&lt;SUP&gt;2&amp;nbsp;&lt;/SUP&gt;);&lt;/P&gt;&lt;P&gt;Is minimized.&lt;/P&gt;&lt;P&gt;I have searched MKL &lt;STRONG&gt;Data Fitting &lt;/STRONG&gt;Library and found that all of routines are &lt;STRONG&gt;Spline&lt;/STRONG&gt;-based.&amp;nbsp; In MKL &lt;STRONG&gt;LAPACK &lt;/STRONG&gt;library, I found some routines the &lt;STRONG&gt;Least Squares&lt;/STRONG&gt; ones.&lt;/P&gt;&lt;P&gt;I understand that,&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;as the order of the polynomial increases, &lt;STRONG&gt;Spline&lt;/STRONG&gt;-based methods are preferable over polynomial interpolation because its interpolation error increases&lt;/LI&gt;&lt;LI&gt;when the number of points&amp;nbsp;of X and Y &amp;gt; (1 +&amp;nbsp;the degree) of the polynomial to be used,&amp;nbsp;the &lt;STRONG&gt;Least Squares &lt;/STRONG&gt;fit will be used&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;However, what I’m looking for&amp;nbsp;is a general Polynomial Fitting function described above.&amp;nbsp; Is there such function in MKL? &amp;nbsp;Where can I find it in MKL (or IPP)?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 03:40:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172795#M28698</guid>
      <dc:creator>LWang77</dc:creator>
      <dc:date>2019-03-20T03:40:43Z</dc:date>
    </item>
    <item>
      <title>The Matlab polyfit routine is</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172796#M28699</link>
      <description>&lt;P&gt;The Matlab &lt;STRONG&gt;polyfit&lt;/STRONG&gt; routine is restricted to fitting with uniform weighting, i.e.,&amp;nbsp;σ&lt;SUB&gt;i&lt;/SUB&gt; is the same for all &lt;EM&gt;i&lt;/EM&gt;. This capability is available in Lapack, in the subroutine ?GELS.&lt;/P&gt;&lt;P&gt;There is no ready-to-use-routine for the non-uniform weights case in MKL, as far as I know, but you should be able to put one together using the matrix manipulation routines that are available in BLAS/Lapack.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 04:18:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172796#M28699</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-03-21T04:18:37Z</dc:date>
    </item>
    <item>
      <title>Thank you for your advice,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172797#M28700</link>
      <description>&lt;P&gt;Thank you for your advice, mecej4!&lt;/P&gt;&lt;P&gt;According to the MKL Reference, the function &lt;STRONG&gt;?gels&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Uses QR or LQ factorization to solve a &lt;STRONG&gt;overdetermined &lt;/STRONG&gt;or &lt;STRONG&gt;underdetermined &lt;/STRONG&gt;linear system with full rank matrix.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The uniform weighting is ok for our application.&amp;nbsp; In addition to the Least Squares fit, however, we are looking for Polynomial Fitting function that determine the coefficients&amp;nbsp;of a polynomial for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number of input points&amp;nbsp;&lt;STRONG&gt;= &lt;/STRONG&gt;(1 +&amp;nbsp;degree) of the polynomial to be used&lt;/P&gt;&lt;P&gt;Is there such Polynomial Fitting function in &lt;STRONG&gt;MKL &lt;/STRONG&gt;(or &lt;STRONG&gt;IPP&lt;/STRONG&gt;)? In other words, we need to calculate the coefficients&amp;nbsp;of a polynomial that neither&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;overdetermined &lt;/STRONG&gt;nor &lt;STRONG&gt;underdetermined&lt;/STRONG&gt;.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 22:05:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172797#M28700</guid>
      <dc:creator>LWang77</dc:creator>
      <dc:date>2019-03-21T22:05:00Z</dc:date>
    </item>
    <item>
      <title>The interpolating polynomial</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172798#M28701</link>
      <description>&lt;P&gt;The interpolating polynomial can be obtained in the Lagrange form explicitly, without any matrix algebra. See&amp;nbsp;https://en.wikipedia.org/wiki/Lagrange_polynomial .&lt;/P&gt;&lt;P&gt;If the coefficients are desired, rather than interpolants, you may use the Lapack routine ?GESV, which is available in MKL.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 10:51:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1172798#M28701</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-03-22T10:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: MKL - General Polynomial Fitting function?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1391789#M33268</link>
      <description>&lt;P&gt;Ok，let me fill and close this question.Here comes the code.I registerd this account just for posting this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;void&lt;/SPAN&gt; &lt;SPAN&gt;cf1&lt;/SPAN&gt;&lt;SPAN&gt;::&lt;/SPAN&gt;&lt;SPAN&gt;pow_matrix&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;double&lt;/SPAN&gt; &lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;a&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;long&lt;/SPAN&gt; &lt;SPAN&gt;n&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;double&lt;/SPAN&gt; &lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;res&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;int&lt;/SPAN&gt; &lt;SPAN&gt;order&lt;/SPAN&gt;&lt;SPAN&gt;){&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;int&lt;/SPAN&gt;&lt;SPAN&gt; i=&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;;i&amp;lt;=order;i++){&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt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t;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;cblas_dgemm&lt;/SPAN&gt;&lt;SPAN&gt;(CblasRowMajor, CblasNoTrans, CblasTrans, order, order, n, &lt;/SPAN&gt;&lt;SPAN&gt;1.0&lt;/SPAN&gt;&lt;SPAN&gt;, px, n, px, n, &lt;/SPAN&gt;&lt;SPAN&gt;0.0&lt;/SPAN&gt;&lt;SPAN&gt;, xtx, order); &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; vector&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;double&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;vxty2beta&lt;/SPAN&gt;&lt;SPAN&gt;(order);&lt;/SPAN&gt;&lt;SPAN&gt;//This vector will be transferred from xty to beta,thanks for the anti-human design of the MKL-API!&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;double&lt;/SPAN&gt;&lt;SPAN&gt; *xty2beta=&lt;/SPAN&gt;&lt;SPAN&gt;vxty2beta&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;cblas_dgemm&lt;/SPAN&gt;&lt;SPAN&gt;(CblasRowMajor, CblasNoTrans, CblasTrans, order, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, n, &lt;/SPAN&gt;&lt;SPAN&gt;1.0&lt;/S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oTrans,n,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,order,&lt;/SPAN&gt;&lt;SPAN&gt;1.0&lt;/SPAN&gt;&lt;SPAN&gt;,px,n,xty2beta,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0.0&lt;/SPAN&gt;&lt;SPAN&gt;,y_,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 11 Jun 2022 07:24:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-General-Polynomial-Fitting-function/m-p/1391789#M33268</guid>
      <dc:creator>karlmarcox</dc:creator>
      <dc:date>2022-06-11T07:24:03Z</dc:date>
    </item>
  </channel>
</rss>

