~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/arma/reglin.man

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH reglin 1 "April 1993" "Scilab Group" "Scilab Function"
2
 
.so ../sci.an
3
 
.SH NAME
4
 
reglin - Linear regression 
5
 
.SH CALLING SEQUENCE
6
 
.nf
7
 
[a,b,sig]=reglin(x,y)
8
 
.fi
9
 
.SH DESCRIPTION
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. 
14
 
.LP
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
17
 
 
18
 
.Sh EXAMPLE 
19
 
.nf
20
 
// simulation of data for a(3,5) and b(3,1)
21
 
x=rand(5,100);
22
 
aa=testmatrix('magi',5);aa=aa(1:3,:);
23
 
bb=[9;10;11]
24
 
y=aa*x +bb*ones(1,100)+ 0.1*rand(3,100);
25
 
// identification 
26
 
[a,b,sig]=reglin(x,y);
27
 
maxi(abs(aa-a))
28
 
maxi(abs(bb-b))
29
 
// an other example : fitting a polynom 
30
 
f=1:100; x=[f.*f; f];
31
 
y= [ 2,3]*x+ 10*ones(f) + 0.1*rand(f);
32
 
[a,b]=reglin(x,y)
33
 
.fi
34
 
.SH SEE ALSO
35
 
pinv, leastsq, qr