lscov
既知の共分散を使用した最小二乗解法
構文
説明
例
入力引数
出力引数
アルゴリズム
一般化最小二乗問題で m 行 n 列の行列 A と m 行 m 列の行列 C がフル ランクの場合、m が n 以上のときの lscov の出力は次の標準式で表されます。
x = inv(A'*inv(C)*A)*A'*inv(C)*b mse = (b - A*x)'*inv(C)*(b - A*x)./(m-n) S = inv(A'*inv(C)*A)*mse stdx = sqrt(diag(S))
m が n 未満のときは平均二乗誤差は 0 です。
重み付き最小二乗では、C の代わりに diag(1./w) を使用するときに標準式が適用されます。通常の最小二乗では、C の代わりに単位行列を使用します。
関数 lscov で使用している方法は標準式よりも高速で安定性が高く、ランク落ちの場合にも適用できます。たとえば、lscov はコレスキー分解 C = R'*R を計算してから、代わりに最小二乗問題 (R'\A)*x = (R'\b) を解きます。これには、最小二乗問題を解くために mldivide で A\b に使用されるのと同じアルゴリズムが使用されます。
参照
[1] Paige, Christopher C. "Computer Solution and Perturbation Analysis of Generalized Linear Least Squares Problems." Mathematics of Computation 33, no. 145 (1979): 171–83. https://doi.org/10.2307/2006034.
[2] Golub, Gene H., and Charles F. Van Loan. Matrix Computations. Baltimore, MD: Johns Hopkins University Press, 1996.
[3] Goodall, Colin R. "Computation using the QR decomposition." Handbook of Statistics 9 (1993): 467–508. https://doi.org/10.1016/S0169-7161(05)80137-3.
[4] Strang, Gilbert. Introduction to Applied Mathematics. Wellesley, MA: Wellesley-Cambridge Press, 1986.
拡張機能
バージョン履歴
R2006a より前に導入
