Scilab Function
Last update : 1/11/2005
multireg - Linear Regression for linear combined
functions
Calling Sequence
-
[a,f] =
multireg(X,Y,q,adone)
Parameters
-
X
: Matrix. Each column represents a variable. The number of rows
represents the amount of statistical samples. Each row represents a
Tupel (x1,x2,...xm).
-
Y
: The function values belonging to the tupels (x1,x2,...,xm). Y
can be a column vector or a matrix
-
q
: Selektion vector. Specifies the coefficients, which should be
calculated.
-
adone
: Vector with predefined coefficients. The number of elements of
ADONE + the number of elements of Q must be m.
-
a
: a is a Vector (or a Matrix, depends on Y) with coefficients.
The solution vector a has m+1 coefficients.
-
f
: The vector f (or matrix) contains the error of the
regression
Description
-
more or less a quite simple linear equation system task. The
squared deviations are minimized. Nice feature for this function: The
user can determine the coefficients he wants to optimize.
-
Several possibilities are supported: (1): Global determination of
optimal parameters. The complete equation system is solved. (2): The
optimal solution is calculated recursevely. The vector Q specifies the
sequence.
Examples
x=rand(10,5);
a=[3;4;2;1;8];
y=x*a-3;
[aopt1,f1]=multireg(x,y)
//Now, only coeff. 1,2 and 4 are optimized.
[aopt2,f2]=multireg(x,y,[1,2,4])
// Coeffs 1, 2 and 4 are calculated.
// Coeffs 3 and 5 are set to 10 and 11
[aopt3,f3]=multireg(x,y,[1,2,4],[10,11])
See Also
gaussfit
,
Authors
-
Dr. Andreas Geissler geisslea@web.de