blob: 4a49800e84c09373597a52e6f634e2247b144546 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.4-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="keywords" content="madlib,postgres,greenplum,machine learning,data mining,deep learning,ensemble methods,data science,market basket analysis,affinity analysis,pca,lda,regression,elastic net,huber white,proportional hazards,k-means,latent dirichlet allocation,bayes,support vector machines,svm"/>
<title>MADlib: linear.sql_in File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<!-- hack in the navigation tree -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="madlib_extra.css" rel="stylesheet" type="text/css"/>
<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45382226-1', 'madlib.apache.org');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><a href="http://madlib.apache.org"><img alt="Logo" src="madlib.png" height="50" style="padding-left:0.5em;" border="0"/ ></a></td>
<td style="padding-left: 0.5em;">
<div id="projectname">
<span id="projectnumber">1.19.0</span>
</div>
<div id="projectbrief">User Documentation for Apache MADlib</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('linear_8sql__in.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">linear.sql_in File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>SQL functions for linear regression.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad0175a9ecc455d9679f7d251af264848"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#ad0175a9ecc455d9679f7d251af264848">linregr_train</a> (varchar source_table, varchar out_table, varchar dependent_varname, varchar independent_varname, varchar grouping_cols, boolean heteroskedasticity_option)</td></tr>
<tr class="memdesc:ad0175a9ecc455d9679f7d251af264848"><td class="mdescLeft">&#160;</td><td class="mdescRight">Linear regression training function with grouping support. <a href="#ad0175a9ecc455d9679f7d251af264848">More...</a><br /></td></tr>
<tr class="separator:ad0175a9ecc455d9679f7d251af264848"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac807cf4749db37b6fc7be24c2db10d96"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#ac807cf4749db37b6fc7be24c2db10d96">linregr_train</a> (varchar source_table, varchar out_table, varchar dependent_varname, varchar independent_varname, varchar grouping_cols)</td></tr>
<tr class="separator:ac807cf4749db37b6fc7be24c2db10d96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71fb4a634f3145d0369879c931e0f16e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a71fb4a634f3145d0369879c931e0f16e">linregr_train</a> (varchar source_table, varchar out_table, varchar dependent_varname, varchar independent_varname)</td></tr>
<tr class="separator:a71fb4a634f3145d0369879c931e0f16e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1469685d518752784080c0b2811c9a81"><td class="memItemLeft" align="right" valign="top">varchar&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a1469685d518752784080c0b2811c9a81">linregr_train</a> ()</td></tr>
<tr class="separator:a1469685d518752784080c0b2811c9a81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f8e25203a2b3a9d0fd332a539972292"><td class="memItemLeft" align="right" valign="top">varchar&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a5f8e25203a2b3a9d0fd332a539972292">linregr_train</a> (varchar message)</td></tr>
<tr class="separator:a5f8e25203a2b3a9d0fd332a539972292"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2b87a3e60272176bfa2fb859f99461a"><td class="memItemLeft" align="right" valign="top">bytea8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#aa2b87a3e60272176bfa2fb859f99461a">linregr_transition</a> (bytea8 state, float8 y, float8[] x)</td></tr>
<tr class="separator:aa2b87a3e60272176bfa2fb859f99461a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a042536820ffbad498a4e1c410f949e35"><td class="memItemLeft" align="right" valign="top">bytea8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a042536820ffbad498a4e1c410f949e35">linregr_merge_states</a> (bytea8 state1, bytea8 state2)</td></tr>
<tr class="separator:a042536820ffbad498a4e1c410f949e35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28b69254ba5cd513b35ba6b17efd2c35"><td class="memItemLeft" align="right" valign="top">linregr_result&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a28b69254ba5cd513b35ba6b17efd2c35">linregr_final</a> (bytea8 state)</td></tr>
<tr class="separator:a28b69254ba5cd513b35ba6b17efd2c35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a583204053716bbece6321f5d9332b1"><td class="memItemLeft" align="right" valign="top">bytea8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a4a583204053716bbece6321f5d9332b1">hetero_linregr_transition</a> (bytea8 state, float8 y, float8[] x, float8[] coef)</td></tr>
<tr class="separator:a4a583204053716bbece6321f5d9332b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad10649c8460c337a285cf20f2b87d0c5"><td class="memItemLeft" align="right" valign="top">bytea8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#ad10649c8460c337a285cf20f2b87d0c5">hetero_linregr_merge_states</a> (bytea8 state1, bytea8 state2)</td></tr>
<tr class="separator:ad10649c8460c337a285cf20f2b87d0c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b2e38f45a8e519af5947fcc2eb02829"><td class="memItemLeft" align="right" valign="top">heteroskedasticity_test_result&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a4b2e38f45a8e519af5947fcc2eb02829">hetero_linregr_final</a> (bytea8 state)</td></tr>
<tr class="separator:a4b2e38f45a8e519af5947fcc2eb02829"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5fcd1daa9796dccf5430929c37ea0ee9"><td class="memItemLeft" align="right" valign="top">aggregate bytea8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a5fcd1daa9796dccf5430929c37ea0ee9">linregr</a> (float8 dependentVariable, float8[] independentVariables)</td></tr>
<tr class="memdesc:a5fcd1daa9796dccf5430929c37ea0ee9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute linear regression coefficients and diagnostic statistics. <a href="#a5fcd1daa9796dccf5430929c37ea0ee9">More...</a><br /></td></tr>
<tr class="separator:a5fcd1daa9796dccf5430929c37ea0ee9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d36a88e06a31753f4045a6c4539ca10"><td class="memItemLeft" align="right" valign="top">aggregate bytea8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a6d36a88e06a31753f4045a6c4539ca10">heteroskedasticity_test_linregr</a> (float8 dependentVariable, float8[] independentVariables, float8[] olsCoefficients)</td></tr>
<tr class="memdesc:a6d36a88e06a31753f4045a6c4539ca10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute studentized Breuch-Pagan heteroskedasticity test for linear regression. <a href="#a6d36a88e06a31753f4045a6c4539ca10">More...</a><br /></td></tr>
<tr class="separator:a6d36a88e06a31753f4045a6c4539ca10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8da0030683d5931b93e5f2bee3fd0544"><td class="memItemLeft" align="right" valign="top">float8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a8da0030683d5931b93e5f2bee3fd0544">linregr_predict</a> (float8[] coef, float8[] col_ind_var)</td></tr>
<tr class="memdesc:a8da0030683d5931b93e5f2bee3fd0544"><td class="mdescLeft">&#160;</td><td class="mdescRight">Predict the boolean value of a dependent variable for a specific independent variable value in a linear regression model. <a href="#a8da0030683d5931b93e5f2bee3fd0544">More...</a><br /></td></tr>
<tr class="separator:a8da0030683d5931b93e5f2bee3fd0544"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98442804f12e5489dedf0ada2d8c273e"><td class="memItemLeft" align="right" valign="top">text&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a98442804f12e5489dedf0ada2d8c273e">linregr_predict</a> (text message)</td></tr>
<tr class="separator:a98442804f12e5489dedf0ada2d8c273e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cf80cdbcabf4ba83b128c08bc804ca5"><td class="memItemLeft" align="right" valign="top">text&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="linear_8sql__in.html#a1cf80cdbcabf4ba83b128c08bc804ca5">linregr_predict</a> ()</td></tr>
<tr class="separator:a1cf80cdbcabf4ba83b128c08bc804ca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><dl class="section date"><dt>Date</dt><dd>January 2011</dd></dl>
<dl class="section see"><dt>See also</dt><dd>For a brief introduction to linear regression, see the module description <a class="el" href="group__grp__linreg.html">Linear Regression</a>. </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a4b2e38f45a8e519af5947fcc2eb02829"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b2e38f45a8e519af5947fcc2eb02829">&#9670;&nbsp;</a></span>hetero_linregr_final()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">heteroskedasticity_test_result hetero_linregr_final </td>
<td>(</td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad10649c8460c337a285cf20f2b87d0c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad10649c8460c337a285cf20f2b87d0c5">&#9670;&nbsp;</a></span>hetero_linregr_merge_states()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bytea8 hetero_linregr_merge_states </td>
<td>(</td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a4a583204053716bbece6321f5d9332b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a583204053716bbece6321f5d9332b1">&#9670;&nbsp;</a></span>hetero_linregr_transition()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bytea8 hetero_linregr_transition </td>
<td>(</td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8&#160;</td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>coef</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a6d36a88e06a31753f4045a6c4539ca10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6d36a88e06a31753f4045a6c4539ca10">&#9670;&nbsp;</a></span>heteroskedasticity_test_linregr()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">aggregate bytea8 heteroskedasticity_test_linregr </td>
<td>(</td>
<td class="paramtype">float8&#160;</td>
<td class="paramname"><em>dependentVariable</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>independentVariables</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>olsCoefficients</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dependentVariable</td><td>Column containing the dependent variable </td></tr>
<tr><td class="paramname">independentVariables</td><td>Column containing the array of independent variables </td></tr>
<tr><td class="paramname">olsCoefficients</td><td>Column containing the array of the OLS coefficients (as obtained by linregr)</td></tr>
</table>
</dd>
</dl>
<dl class="section user"><dt></dt><dd>To include an intercept in the model, set one coordinate in the <code>independentVariables</code> array to 1.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>A composite value:<ul>
<li><code>test_statistic FLOAT8[]</code> - Prob &gt; test_statistc</li>
<li><code>p_value FLOAT8[]</code> - Prob &gt; test_statistc</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><pre> SELECT (heteoskedasticity_test_linregr(<em>dependentVariable</em>,
<em>independentVariables</em>, coef)).*
FROM (
SELECT linregr(<em>dependentVariable</em>, <em>independentVariables</em>).coef
) AS ols_coef, <em>sourceName</em> as src;
</pre> </dd></dl>
</div>
</div>
<a id="a5fcd1daa9796dccf5430929c37ea0ee9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5fcd1daa9796dccf5430929c37ea0ee9">&#9670;&nbsp;</a></span>linregr()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">aggregate bytea8 linregr </td>
<td>(</td>
<td class="paramtype">float8&#160;</td>
<td class="paramname"><em>dependentVariable</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>independentVariables</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dependentVariable</td><td>Column containing the dependent variable </td></tr>
<tr><td class="paramname">independentVariables</td><td>Column containing the array of independent variables</td></tr>
</table>
</dd>
</dl>
<dl class="section user"><dt></dt><dd>To include an intercept in the model, set one coordinate in the <code>independentVariables</code> array to 1.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>A composite value:<ul>
<li><code>coef FLOAT8[]</code> - Array of coefficients, \( \boldsymbol c \)</li>
<li><code>r2 FLOAT8</code> - Coefficient of determination, \( R^2 \)</li>
<li><code>std_err FLOAT8[]</code> - Array of standard errors, \( \mathit{se}(c_1), \dots, \mathit{se}(c_k) \)</li>
<li><code>t_stats FLOAT8[]</code> - Array of t-statistics, \( \boldsymbol t \)</li>
<li><code>p_values FLOAT8[]</code> - Array of p-values, \( \boldsymbol p \)</li>
<li><code>condition_no FLOAT8</code> - The condition number of matrix \( X^T X \).</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><ul>
<li>Get vector of coefficients \( \boldsymbol c \) and all diagnostic statistics:<br />
<pre>SELECT (linregr(<em>dependentVariable</em>,
<em>independentVariables</em>)).*
FROM <em>sourceName</em>;</pre></li>
<li>Get vector of coefficients \( \boldsymbol c \):<br />
<pre>SELECT (linregr(<em>dependentVariable</em>,
<em>independentVariables</em>)).coef
FROM <em>sourceName</em>;</pre></li>
<li>Get a subset of the output columns, e.g., only the array of coefficients \( \boldsymbol c \), the coefficient of determination \( R^2 \), and the array of p-values \( \boldsymbol p \): <pre>SELECT (lr).coef, (lr).r2, (lr).p_values
FROM (
SELECT linregr( <em>dependentVariable</em>,
<em>independentVariables</em>) AS lr
FROM <em>sourceName</em>
) AS subq;</pre> </li>
</ul>
</dd></dl>
</div>
</div>
<a id="a28b69254ba5cd513b35ba6b17efd2c35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28b69254ba5cd513b35ba6b17efd2c35">&#9670;&nbsp;</a></span>linregr_final()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">linregr_result linregr_final </td>
<td>(</td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a042536820ffbad498a4e1c410f949e35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a042536820ffbad498a4e1c410f949e35">&#9670;&nbsp;</a></span>linregr_merge_states()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bytea8 linregr_merge_states </td>
<td>(</td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a8da0030683d5931b93e5f2bee3fd0544"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8da0030683d5931b93e5f2bee3fd0544">&#9670;&nbsp;</a></span>linregr_predict() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float8 linregr_predict </td>
<td>(</td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>coef</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>col_ind_var</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">coef</td><td>Coefficients obtained by running linear regression. </td></tr>
<tr><td class="paramname">col_ind</td><td>Independent variable array </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>DOUBLE PRECISION Predicted value</dd></dl>
<p>This function computes the dot product of the independent variables and the coefficients. This requires the length of the two vectors to be the same. </p>
</div>
</div>
<a id="a98442804f12e5489dedf0ada2d8c273e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a98442804f12e5489dedf0ada2d8c273e">&#9670;&nbsp;</a></span>linregr_predict() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">text linregr_predict </td>
<td>(</td>
<td class="paramtype">text&#160;</td>
<td class="paramname"><em>message</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a1cf80cdbcabf4ba83b128c08bc804ca5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1cf80cdbcabf4ba83b128c08bc804ca5">&#9670;&nbsp;</a></span>linregr_predict() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">text linregr_predict </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad0175a9ecc455d9679f7d251af264848"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad0175a9ecc455d9679f7d251af264848">&#9670;&nbsp;</a></span>linregr_train() <span class="overload">[1/5]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void linregr_train </td>
<td>(</td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>source_table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>out_table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>dependent_varname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>independent_varname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>grouping_cols</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">boolean&#160;</td>
<td class="paramname"><em>heteroskedasticity_option</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ac807cf4749db37b6fc7be24c2db10d96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac807cf4749db37b6fc7be24c2db10d96">&#9670;&nbsp;</a></span>linregr_train() <span class="overload">[2/5]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void linregr_train </td>
<td>(</td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>source_table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>out_table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>dependent_varname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>independent_varname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>grouping_cols</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a71fb4a634f3145d0369879c931e0f16e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71fb4a634f3145d0369879c931e0f16e">&#9670;&nbsp;</a></span>linregr_train() <span class="overload">[3/5]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void linregr_train </td>
<td>(</td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>source_table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>out_table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>dependent_varname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>independent_varname</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a1469685d518752784080c0b2811c9a81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1469685d518752784080c0b2811c9a81">&#9670;&nbsp;</a></span>linregr_train() <span class="overload">[4/5]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">varchar linregr_train </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a5f8e25203a2b3a9d0fd332a539972292"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5f8e25203a2b3a9d0fd332a539972292">&#9670;&nbsp;</a></span>linregr_train() <span class="overload">[5/5]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">varchar linregr_train </td>
<td>(</td>
<td class="paramtype">varchar&#160;</td>
<td class="paramname"><em>message</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aa2b87a3e60272176bfa2fb859f99461a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2b87a3e60272176bfa2fb859f99461a">&#9670;&nbsp;</a></span>linregr_transition()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bytea8 linregr_transition </td>
<td>(</td>
<td class="paramtype">bytea8&#160;</td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8&#160;</td>
<td class="paramname"><em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float8 []&#160;</td>
<td class="paramname"><em>x</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_efbcf68973d247bbf15f9eecae7f24e3.html">ports</a></li><li class="navelem"><a class="el" href="dir_a4a48839224ef8488facbffa8a397967.html">postgres</a></li><li class="navelem"><a class="el" href="dir_dc596537ad427a4d866006d1a3e1fe29.html">modules</a></li><li class="navelem"><a class="el" href="dir_ac52a4b89b7b1b1591f2952b5cbd041a.html">regress</a></li><li class="navelem"><a class="el" href="linear_8sql__in.html">linear.sql_in</a></li>
<li class="footer">Generated on Wed Dec 15 2021 20:27:18 for MADlib by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>