Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.1 - 日本語

Change language to:
English - Français - Português - Русский

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

Scilabヘルプ >> Statistics > reglin

reglin

線形回帰

C呼び出し手順

[a,b,sig]=reglin(x,y)

説明

最小二乗解として回帰問題y=a*x+ bを解きます. sig は残差の標準偏差です. x および y は大きさ x(p,n) および y(q,n) の行列, ただしnはサンプル数,です.

推定器 a は大きさ (q,p) の行列, bは大きさ (q,1)のベクトルです.

// simulation of data for a(3,5) and b(3,1)
x=rand(5,100);
aa=testmatrix('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 polynomial
f=1:100; x=[f.*f; f];
y= [ 2,3]*x+ 10*ones(f) + 0.1*rand(f);
[a,b]=reglin(x,y)

参照

  • pinv — 擬似逆行列
  • leastsq — Solves non-linear least squares problems
  • qr — QR 分解
Report an issue
<< labostat Statistics Sparses Matrix >>

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:
Thu Oct 02 13:58:24 CEST 2014