fit discrete data points with linear combination of discrete user-defined functions
3 ビュー (過去 30 日間)
古いコメントを表示
Hello,
Can anyone please suggest how to fit a discrete data points D(X) defined on X = start:1:end by a linear combination of N = size(X,1) discrete user-defined instrument response functions (IRFs). IRFs are defined on the same field X.
For example
X = [-2 -1 0 1 2];
D = [3.1 3 2.6 2.4 2.5];
%IRFs(technically should be orthogonal or "almost" orthogonal):
A1 = [3 2 1 0 1 ];
A2 = [1 3 2 1 0 ];
A3 = [1 2 3 2 1 ];
A4 = [0 1 2 3 2 ];
A5 = [1 0 1 2 3 ];
I am looking for scalar coefficients a1...a5, that will minimize D - sum(a1*A1, a2*A2, a3*A3,...).
EDITED: How to request coefficients a_i to be only positive and\or within some boundaries?
Thanks a lot
Konstantin
0 件のコメント
採用された回答
Star Strider
2015 年 8 月 13 日
I don’t understand how ‘X’ enters into the calculation, if it does. Otherwise, it seems a straightforward least-squares parameter estimation:
a = [A1' A2' A3' A4' A5']\D';
2 件のコメント
Star Strider
2015 年 8 月 14 日
If you only want to specify C, d, lb, and ub, use square brackets [] to specify empty arguments. All arguments have to be in order, so fill the ones you don’t need with square brackets:
x = lsqlin(C,d,[],[],[],[],lb,ub)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!