Optimizing parameters for a system of linear equations

2 views (last 30 days)
This is rather an easy problem but I cannot get my head around with it. Please help. The question is followign:
I have two data sets in the form of F(fi, xi) and G(gi, xi) with i = 1..65. These two curves supposed to be the same but different in raw format. I want to find the parameters that make these two curves equal such that
aF + bG = 0, or ai * fi + bi * gi = 0 subject to .
In matrix form,
constraints:
I want to find a's and b's.
How do I do it in matlab?
  1 Comment
LS_SL
LS_SL on 8 Jan 2019
I mistyped the functional form of F and G. It should be corrected as F = F(xi, fi) and G = G(xi, gi).

Sign in to comment.

Answers (2)

Torsten
Torsten on 8 Jan 2019
One possible choice:
a_i = g_i / 2 * sum_{j=1}^{j=65} (f_j - g_j) / sum_{j=1}^{j=65} (f_j * g_j)
b_i = -f_i / 2 * sum_{j=1}^{j=65} (f_j - g_j) / sum_{j=1}^{j=65} (f_j * g_j)
Best wishes
Torsten.

LS_SL
LS_SL on 8 Jan 2019
Hi Torsten,
Thanks for your suggestion. These two equations algibircally solve for the coefficients ai, bi.
One qeustion remains: How do I incorporate the contraint?
That's where I thought optimization methods would help. Any idea?
  1 Comment
Torsten
Torsten on 8 Jan 2019
But they satisfy the constraint ...
Or do you want to prescribe a fixed value for "constant" in
sum_{j=1}^{j=65} (a(j)-1)*f(j) = sum_{j=1}^{j=65} (b(j)-1)*g(j) = constant
?

Sign in to comment.

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!