Programmer Guide/Command Reference/EVAL/rleqs: Difference between revisions

From STX Wiki
Jump to navigationJump to search
(Created page with '{{DISPLAYTITLE:rleqs, cleqs}} These functions implements an interface for the LAPACK functions DGESV, ZGESV, DGELS and ZGELS. ;Usage: <code>rleqs(<var>A</var>, <var>B</var> {, <v…')
 
No edit summary
Line 14: Line 14:
;Description:
;Description:
:;<var>m</var>: the regression (polynom) order; m>0 (default=1)
:;<var>m</var>: the regression (polynom) order; m>0 (default=1)
;Result 1: Approximate the function ''y'' using polynominal regression. The result is the vector ''r'' with the ''m''+1 coefficients of the regression polynom.
;Result: Approximate the function ''y'' using polynominal regression. The result is the vector ''r'' with the ''m''+1 coefficients of the regression polynom.
::<code>''y''<sub>REG</sub>[i] = ''r''[0] + ''r''[1]*''x''[i] {+ ''r''[2]*''x''[i]^2 + .. + ''r''[''m'']*''x''[i]^''m''}</code>
::<code>''y''<sub>REG</sub>[i] = ''r''[0] + ''r''[1]*''x''[i] {+ ''r''[2]*''x''[i]^2 + .. + ''r''[''m'']*''x''[i]^''m''}</code>


Note: The function <code>cleqs(<var>A</var>, <var>B</var> {, <var>alg</var>})</code> has the same arguments and result as <code>rleqs</code>, but the vectors/matrices ''A'', ''B'' and ''X'' are [[Programmer_Guide/Command_Reference/EVAL/complex arithmetic|complex]].
Note: The function <code>cleqs(<var>A</var>, <var>B</var> {, <var>alg</var>})</code> has the same arguments and result as <code>rleqs</code>, but the vectors/matrices ''A'', ''B'' and ''X'' are [[Programmer_Guide/Command_Reference/EVAL/complex arithmetic|complex]].


;Usage 2: <code>rpolyreg(<var>x<sub>matrix</sub></var>, <var>y<sub>vector</sub></var> {, <var>m</var>})</code>:
 
:;<var>x</var>: ''x'' data matrix, the regression order is the number of independent variables <code>''m''=ncol(''x'')</code>
:;<var>y</var>: ''y'' data vector: <code>''y''[i] = f(''x''[i,*])</code>
;Result 2: Approximate the function ''y'' using multivariant linear regression. The result is the vector ''r'' with the ''m''+1 regression coefficients.
::<code>''y''<sub>REG</sub>[i] = ''r''[0] + ''r''[1]*''x''[i,0] + .. + ''r''[''m'']*''x''[i,''m''-1]</code>
----
;See also: [[Programmer_Guide/Command_Reference/EVAL/rpoly|rpoly]], [[Programmer_Guide/Command_Reference/EVAL/interp|interp]], [[Programmer_Guide/Command_Reference/EVAL/rleqs|rleqs, cleqs]]
;See also: [[Programmer_Guide/Command_Reference/EVAL/rpoly|rpoly]], [[Programmer_Guide/Command_Reference/EVAL/interp|interp]], [[Programmer_Guide/Command_Reference/EVAL/rleqs|rleqs, cleqs]]


[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Revision as of 16:53, 12 April 2011

These functions implements an interface for the LAPACK functions DGESV, ZGESV, DGELS and ZGELS.

Usage
rleqs(A, B {, alg}):
A
left side MxN matrix x
B
right side vector or MxL matrix (for multiple solutions)
alg
select a LAPACK algorithm to be used
{class="keinrahmen"

|alg=0 || use DGESV if M=N and DGELS otherwise |- |alg=1 || use always DGESV, M must be equal to N |- |alg=2 || use always DGELS |}

Description
m
the regression (polynom) order; m>0 (default=1)
Result
Approximate the function y using polynominal regression. The result is the vector r with the m+1 coefficients of the regression polynom.
yREG[i] = r[0] + r[1]*x[i] {+ r[2]*x[i]^2 + .. + r[m]*x[i]^m}

Note: The function cleqs(A, B {, alg}) has the same arguments and result as rleqs, but the vectors/matrices A, B and X are complex.


See also
rpoly, interp, rleqs, cleqs

<function list>

Navigation menu

Personal tools