Curve fit minimizing the sum of the deviation I'm fitting a curve taking the smaller sum of deviations for each parameter tested, the smaller sum returns me the parameter that gives the best fit. Here is the algorithm for a test $f(x, parameter)$:
function fit(function:function, list:sample_y, list:x_values, list:parameter_values):
    sums = []
    for each parameter in parameter_values:
        y = function(x_values, parameter)
        deviations = sum(abs(sample_y - y))
        sums.push(deviations)
    end for
    smaller_deviation = min(sums)
    parameter_index = sums.index_of(smaller_deviation)
    return parameter_values[parameter_index]
end function

This method is working. I can minize the error giving a nice band of parameters.
I'd like to know whether is valid fit data in this way and, if It's valid, this method has a name?
Obs.: I'm avoiding using levemberg-maquardt and least squares methods...

Translation:
There is some function $f : A \times B \to C$ where $A$, $B$ and $C$ are some sets of objects, where $C$ supports addition, subtraction, taking the absolute value and determining a minimal element. 


*

*$x$ is a countable subset of $A$.

*$p$ is a countable subset of $B$, called parameters.

*$y$ is a countable subset of $C$, called samples.


For all $i$ that index $p$, the values
$$
D_i = \sum_j \left\lvert y_j - f(x_j, p_i) \right\rvert
$$
are calculated and from this the minimum
$$
d = \min_i D_i
$$
The result is 
$$
\DeclareMathOperator*{\argmin}{arg\,min}
p_k
$$
with
$$
k = \argmin_i D_i
$$
Interpretation:
Let $n$ be the number of different $p$ values, then this leads to the calculation of $n$ vectors $\tilde{y}_i = (f(x_j, p_i))$ which each have a distance $D_i$ to the sample vector $y$ in the 1-norm:
$$
D_i = \lVert y - \tilde{y} \rVert_1
$$
The algorithm returns the parameter $p_k$ associated to a closest vector $\tilde{y}_k$ to $y$.
