Answers to: OLAP with non-linear regression testshttps://sqlanywhere-forum.sap.com/questions/5624/olap-with-non-linear-regression-tests<p>I have just found out that these OLAP functions (introduced in v9.0.2) are very handy to do linear regression tests, namely REGR_SLOPE(), REGR_INTERCEPT() and REGR_R2(). It was much easier to do so than I had thought - being no expert in this field at all...and they seem real fast.</p>
<p>(A deep thanks to Glenn for the <a href="http://www.sybase.com/detail?id=1037447">OLAP whitepaper</a>, by the way!)</p>
<p>Now I would like to ask if it's possible with theses or other functions to test for other forms of regression tests, e.g. with the help of polynoms or logarithical functions - as can be done with Excel.</p>
<p>(Yep, I'm aware that this might be more a mathematical question...)</p>enWed, 15 Jun 2011 01:13:44 -0400Answer by Glenn Paulleyhttps://sqlanywhere-forum.sap.com/questions/5624/olap-with-non-linear-regression-tests/5758<p>Only linear regression of a function y = a + bx is supported by the current set of functions, but that doesn't necessarily mean that you can only use the regression functions for linear equations. For example, you might model an exponential regression y = bx**a by taking the logarithm of both sides, that is, ln y = ln b + a ln x. You could then solve for ln y using the supported linear regression functions, and take the exponent after that to determine the value of y. There are examples of doing these sorts of transformations in Raj Jain's book, referenced in the OLAP whitepaper, and there is a brief example of doing this in the <a href="http://www.sybase.com/detail?id=1056535">capacity planning</a> whitepaper (see Section 5.4.2). </p>
<p>Handling arbitrary types of regressions could be supported by user-defined aggregate and window functions, which SQL Anywhere does not currently support.</p>Glenn PaulleyWed, 15 Jun 2011 01:13:44 -0400https://sqlanywhere-forum.sap.com/questions/5624/olap-with-non-linear-regression-tests/5758