Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.1 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> CACSD (Computer Aided Control Systems Design) > reglin


Linear regression

Calling Sequence



solve the regression problem y=a*x+ b in the least square sense. sig is the standard deviation of the residual. x and y are two matrices of size x(p,n) and y(q,n), where n is the number of samples.

The estimator a is a matrix of size (q,p) and b is a vector of size (q,1)


// simulation of data for a(3,5) and b(3,1)
y=aa*x +bb*ones(1,100)+ 0.1*rand(3,100);

// identification

// an other example : fitting a polynomial
f=1:100; x=[f.*f; f];
y= [ 2,3]*x+ 10*ones(f) + 0.1*rand(f);

See Also

  • pinv — pseudo-inverse
  • leastsq — Solves non-linear least squares problems
  • qr — factorisation QR
Report an issue
<< projsl CACSD (Computer Aided Control Systems Design) repfreq >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:36:46 CEST 2013