Scilab 5.3.3
      
      - Scilab help
 - Linear Algebra
 - aff2ab
 - balanc
 - bdiag
 - chfact
 - chol
 - chsolve
 - classmarkov
 - cmb_lin
 - coff
 - colcomp
 - companion
 - cond
 - det
 - eigenmarkov
 - ereduc
 - expm
 - fstair
 - fullrf
 - fullrfk
 - genmarkov
 - givens
 - glever
 - gschur
 - gspec
 - hess
 - householder
 - im_inv
 - inv
 - kernel
 - kroneck
 - linsolve
 - lsq
 - lu
 - lyap
 - nlev
 - orth
 - pbig
 - pencan
 - penlaur
 - pinv
 - polar
 - proj
 - projspec
 - psmall
 - qr
 - quaskro
 - randpencil
 - range
 - rank
 - rankqr
 - rcond
 - rowcomp
 - rowshuff
 - rref
 - schur
 - spaninter
 - spanplus
 - spantwo
 - spec
 - sqroot
 - squeeze
 - sva
 - svd
 - sylv
 - trace
 
Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
lsq
線形最小二乗問題.
呼び出し手順
X=lsq(A,B [,tol])
パラメータ
- A
 実数または複素数の (m x n) 行列
- B
 実数または複素数の (m x p) 行列
- tol
 Aの実効ランクを定義するために使用される正のスカラー (Aのピボット操作付きQR分解における最前部にある部分三角行列R11の次数として 定義され,条件数の推定値は<= 1/tolとなります. tolのデフォルト値は
sqrt(%eps)に設定されます )- X
 実数または複素数の (n x p) 行列
説明
X=lsq(A,B) は方程式 A*X=Bの
	最小二乗解の最小ノルムを計算します.
	一方, X=A \ Bは
	各列に最大rank(A)個の非ゼロ要素を有する最小二乗解を計算します.
参考文献
lsq 関数はLApack 関数 DGELSY (実行列の場合)および
	 ZGELSY (複素行列の場合)に基づいています.
例
//Build the data x=(1:10)'; y1=3*x+4.5+3*rand(x,'normal'); y2=1.8*x+0.5+2*rand(x,'normal'); plot2d(x,[y1,y2],[-2,-3]) //Find the linear regression A=[x,ones(x)];B=[y1,y2]; X=lsq(A,B); y1e=X(1,1)*x+X(2,1); y2e=X(1,2)*x+X(2,2); plot2d(x,[y1e,y2e],[2,3]) //Difference between lsq(A,b) and A\b A=rand(4,2)*rand(2,3);//a rank 2 matrix b=rand(4,1); X1=lsq(A,b) X2=A\b [A*X1-b, A*X2-b] //the residuals are the same
| << linsolve | Linear Algebra | lu >> |