File: reglin.man

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (30 lines) | stat: -rw-r--r-- 837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.TH reglin 1 "April 1993" "Scilab Group" "Scilab Function"
.so ../sci.an
.SH NAME
reglin - Linear regression 
.SH CALLING SEQUENCE
.nf
[a,b,sig]=reglin(x,y)
.fi
.SH DESCRIPTION
solve the regression problem y=a*x+ b in the least square sense. 
\fRsig\fV is the standard deviation of the residual. \fVx\fR and \fVy\fR
are two matrices of size \fRx(p,n)\fV and \fRy(q,n)\fV, so the estimator 
\fRa\fV is a matrix 
of size \fV(q,p)\fR and \fRb\fV is a vector of size \fR(q,1)\fV
.SH EXAMPLE 
.nf
// simulation of data for a(3,5) and b(3,1)
x=rand(5,100);
aa=matrix('magi',5);aa=aa(1:3,:);
bb=[9;10;11]
y=aa*x +bb*ones(1,100)+ 0.1*rand(3,100);
// identification 
[a,b,sig]=reglin(x,y);
maxi(abs(aa-a))
maxi(abs(bb-b))
// an other example : fitting a polynom 
f=1:100; x=[f.*f; f];
y= [ 2,3]*x+ 10*ones(f) + 0.1*rand(f);
[a,b]=reglin(x,y)
.fi