Optimization of magnitude involved least squares problem

39 Views Asked by At

Given a matrix of $k \times n$ complex-valued $f_{ij}$ for $1 \leq i \leq k$ and $1 \leq j \leq n$. I would like to minimize the following cost function for real valued $g_i$:

$$ \sum_{j=1}^n \left( \left\vert \sum_{i=1}^k g_i f_{ij} \right\vert - 1 \right)^2. $$

What is the best way to formulate the optimization problem?

1

There are 1 best solutions below

0
On

For example, in Matlab or Octave:

%generate an example complex-valued matrix
k = 3; n = 5;
F = randn(k, n) .* exp(i*2*pi*rand(k, n));
%define the cost function
cost = @(g) sum((abs(g' * F) - 1) .^ 2);
%initial guess for g
g_init = ones(k, 1) / k;
%look for a minimum
[g_optim, cost_min] = fminsearch(cost, g_init);