1
.TH reglin 1 "April 1993" "Scilab Group" "Scilab Function"
4
reglin - Linear regression
10
solve the regression problem y=a*x+ b in the least square sense.
11
\fRsig\fV is the standard deviation of the residual. \fVx\fR and \fVy\fR
12
are two matrices of size \fRx(p,n)\fV and \fRy(q,n)\fV, where \fVn\fR
13
is the number of samples.
15
The estimator \fRa\fV is a matrix of size \fV(q,p)\fR and \fRb\fV is a
16
vector of size \fR(q,1)\fV
20
// simulation of data for a(3,5) and b(3,1)
22
aa=testmatrix('magi',5);aa=aa(1:3,:);
24
y=aa*x +bb*ones(1,100)+ 0.1*rand(3,100);
26
[a,b,sig]=reglin(x,y);
29
// an other example : fitting a polynom
31
y= [ 2,3]*x+ 10*ones(f) + 0.1*rand(f);