<?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 Re: Linear Regression in IPP in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895281#M11983</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;Maybe this implementation would gain in speed over the other one. I'll let you try it.&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[cpp]void LinearRegression_64f(const Ipp64f* pSrcX, const Ipp64f* pSrcY, int length, Ipp64f *a, Ipp64f *b)  
{  
Ipp64f cov_xy;  
Ipp64f mean_x;  
Ipp64f mean_y;  
Ipp64f var_x;  
  
ippsMean_64f(pSrcX, length, &amp;amp;mean_x);  
ippsMean_64f(pSrcY, length, &amp;amp;mean_y);  
ippsDotProd_64f(pSrcX, pSrcY, length, &amp;amp;cov_xy);  
   
cov_xy = (cov_xy / (double)length) - mean_x * mean_y;   

ippsDotProd_64f(pSrcX, pSrcX, length, &amp;amp;var_x);
  
var_x = (var_x / (double)length) - mean_x * mean_x; 
       
 *a = cov_xy / var_x;  
 *b = mean_y - *a * mean_x;  
 }[/cpp]&lt;/PRE&gt;
&lt;/P&gt;</description>
    <pubDate>Wed, 26 Nov 2008 08:30:11 GMT</pubDate>
    <dc:creator>matthieu_darbois</dc:creator>
    <dc:date>2008-11-26T08:30:11Z</dc:date>
    <item>
      <title>Linear Regression in IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895278#M11980</link>
      <description>&lt;P&gt;I would like to calculate simple linear regression coefficients with IPP:&lt;BR /&gt;Y=a+bX &lt;BR /&gt;Where Y is the dependent variable, a is the y intercept, b is the gradient or slope of the line, &lt;BR /&gt;X is independent variable&lt;BR /&gt;&lt;BR /&gt;Are there simple example how to do that with IPP?&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;BR /&gt;Constantine&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2008 20:06:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895278#M11980</guid>
      <dc:creator>constantine-vassilev</dc:creator>
      <dc:date>2008-11-25T20:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Regression in IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895279#M11981</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you could do that with a few ipps functions. Here is some code which I haven't use for sometime so feel free to check for the exactness of the formula used.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[cpp]void LinearRegression_64f(const Ipp64f* pSrcX, const Ipp64f* pSrcY, int length, Ipp64f *a, Ipp64f *b)
{
Ipp64f cov_xy;
Ipp64f mean_x;
Ipp64f mean_y;
Ipp64f var_x;

ippsMean_64f(pSrcX, length, &amp;amp;mean_x);
ippsMean_64f(pSrcY, length, &amp;amp;mean_y);
ippsDotProd_64f(pSrcX, pSrcY, length, &amp;amp;cov_xy);

cov_xy = (cov_xy / (double)length) - mean_x * mean_y; 
    
ippsStdDev_64f(pSrcX, length, &amp;amp;var_x);
var_x = var_x * var_x;
    
*a = cov_xy / var_x;
*b = mean_y - *a * mean_x;
}[/cpp]&lt;/PRE&gt;
&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2008 08:17:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895279#M11981</guid>
      <dc:creator>matthieu_darbois</dc:creator>
      <dc:date>2008-11-26T08:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Regression in IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895280#M11982</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;Hi again,&lt;/P&gt;
&lt;P&gt;A little mistake in the code I gave you. It's for Y = aX+b and not Y = a + bX as you asked.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Matthieu&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2008 08:19:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895280#M11982</guid>
      <dc:creator>matthieu_darbois</dc:creator>
      <dc:date>2008-11-26T08:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Regression in IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895281#M11983</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;Maybe this implementation would gain in speed over the other one. I'll let you try it.&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[cpp]void LinearRegression_64f(const Ipp64f* pSrcX, const Ipp64f* pSrcY, int length, Ipp64f *a, Ipp64f *b)  
{  
Ipp64f cov_xy;  
Ipp64f mean_x;  
Ipp64f mean_y;  
Ipp64f var_x;  
  
ippsMean_64f(pSrcX, length, &amp;amp;mean_x);  
ippsMean_64f(pSrcY, length, &amp;amp;mean_y);  
ippsDotProd_64f(pSrcX, pSrcY, length, &amp;amp;cov_xy);  
   
cov_xy = (cov_xy / (double)length) - mean_x * mean_y;   

ippsDotProd_64f(pSrcX, pSrcX, length, &amp;amp;var_x);
  
var_x = (var_x / (double)length) - mean_x * mean_x; 
       
 *a = cov_xy / var_x;  
 *b = mean_y - *a * mean_x;  
 }[/cpp]&lt;/PRE&gt;
&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2008 08:30:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895281#M11983</guid>
      <dc:creator>matthieu_darbois</dc:creator>
      <dc:date>2008-11-26T08:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Linear Regression in IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895282#M11984</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/404840"&gt;matthieu.darbois&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;Maybe this implementation would gain in speed over the other one. I'll let you try it.&lt;/P&gt;
&lt;P&gt;void LinearRegression_64f(const Ipp64f* pSrcX, const Ipp64f* pSrcY, int length, Ipp64f *a, Ipp64f *b) { Ipp64f cov_xy; Ipp64f mean_x; Ipp64f mean_y; Ipp64f var_x; ippsMean_64f(pSrcX, length, &amp;amp;mean_x); ippsMean_64f(pSrcY, length, &amp;amp;mean_y); ippsDotProd_64f(pSrcX, pSrcY, length, &amp;amp;cov_xy); cov_xy = (cov_xy / (double)length) - mean_x * mean_y; ippsDotProd_64f(pSrcX, pSrcX, length, &amp;amp;var_x); var_x = (var_x / (double)length) - mean_x * mean_x; *a = cov_xy / var_x; *b = mean_y - *a * mean_x; }
&lt;PRE&gt;&lt;/PRE&gt;
&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Thanks a lot - I will try it now.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2008 16:06:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Linear-Regression-in-IPP/m-p/895282#M11984</guid>
      <dc:creator>constantine-vassilev</dc:creator>
      <dc:date>2008-11-26T16:06:18Z</dc:date>
    </item>
  </channel>
</rss>

