fit discrete data points with linear combination of discrete user-defined functions
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Konstantin Kudinov
el 13 de Ag. de 2015
Comentada: Star Strider
el 14 de Ag. de 2015
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 comentarios
Respuesta aceptada
Star Strider
el 13 de Ag. de 2015
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 comentarios
Star Strider
el 14 de Ag. de 2015
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)
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!