Optimize a function in terms of the limit of the summatory

26 Views Asked by At

I have the following function:

$$ V_L=\frac{1}{N} \sum_{k=0}^{N-1} (y[k]- g[k]*u[k]) $$

This cost function must be minimized by the linear least squares method to estimate the model parameters for orders varying from $1$ to $100$, i.e., I must find the order that gives the lowest value of the cost function.

If I am correct, the problem written with matrix nomenclature would be:

$$ V_L=\frac{1}{N}(Y-UG) $$

where Y is an $N\times1$ matrix, U is an $N\times n$ matrix and G an $n\times1$ matrix containing the $n$ parameters.

As $n$ doesn't appear itself in the cost function I don't know how to derive it and give the optimal expression.

I solved the problem numerically in Matlab, with a loop in which the order was increasing from $1$ to $100$, and obtained the cost function plot, so I could determine which order gave the lowest cost, but I don't know how to derive the expression.

I would be very thankful for any help.