# Genetic algorithm for parameter estimation

I am a bit confused about parameter estimation using evolutionary methods and their ability to do such a job. Since I am not that pro in stat I am describing my problem with giving an example.

Given different response variable, say Y and in my example molecular weight there are different constant value/weight that can lift up our variables (atoms) to hit that response value. The example is molecular weight of molecules. There is 10 molecule which combined by 100 different atom and we are wondering about weight of each atoms.

Say $CCOOONH$ is one of the molecules and we know its molecular weight, $\alpha$ so the equation is like $\alpha$= 2$C_w$+3$O_w$+1$N_w$+1$H_w$.

My question is manly focus on the relation that GA or other evolutionary methods are able to derive (can they catch a nonlinear relation?!), how much it depends on the fitness function (if I work with a nonlinear fitness function) and finally, could you provide some survey or packages which are relevant?

Could you elaborate more about choosing a proper fitness function in your answer, for instance in my question ... could it be a simple correlation function of a new linear combination of variables and the response variable?!
How about ordering variable, meaning some variable could be look like $\alpha$ = 2$C_w$^$\gamma_1$+3$O_w$^$\gamma_2$+1$N_w$^$\gamma_3$+1$H_w$^$\gamma_4$ which apparently has a heavier computation.

• I'm sorry, but I can't understand what exactly you are looking for. What is your independent variable (the function), the dependent variables (the input values) and the parameters are? – Boris Gorelik Jun 28 '11 at 6:03
• Your "question" is really 5 different ones. If you want to ask for an appropriate fitness function for your situation, perhaps ask another question. – dfrankow Jun 29 '11 at 5:10

Yes, genetic algorithms can find maxima in a non-linear fitness function. Mutation corresponds to a random search of the space. It may take too long for you to get results.

Choosing the right fitness function is crucial. That specifies the goal, and route to the goal. A lot of the results you get depend on the fitness function. The smoother the fitness function, the more it points towards the maximum at any point, the easier it is to climb to that maximum.

An overview is on Wikipedia.

For packages in Java, see stackoverflow. I used WatchMaker and it was fine.

Here's a package that might help: DEoptim

Notice the vignettes.

Your problem is essentially an optimization problem. Such problems are formulated as follows:

$$\begin{array}{ll} \text{Minimize} & F(X) \\ \text{Such that} & X \in D \end{array}$$ where $D$ is the domain of the objective function $F$, called the search space. Genetic algorithms are able to deal with optimization, even if $F$ is nonlinear.

If the response $Y(M)$ of the molecule $M$ is a priori known, your goal will be to define a function $Z(M)$ such to minimize $|Y(M)-Z(M)|$. Let us say that $Z$ is your nonlinear function and that it depends on the coefficients: $w_1, w_2, \ldots, w_m$. I suppose that you have a sample of molecules $M_1, M_2, \ldots, M_N$ on which you will train $Z$. After evaluating $Z(M_1), Z(M_2),\ldots,Z(M_N)$, you can define $F$ as follows: $$F(w_1, w_2, \ldots, w_m) = \frac 1 N \sum_{i=1}^{N}\left|Z(M_i)-Y(M_i)\right|$$ In the ideal case, GA will find $w_1, w_2, \ldots, w_m$ such that $Z(M)=Y(M)$, but this is not realistic to expect since GA does not guarantee to find the optimal solution. No metaheuristic provides such guarantees.

My advice is to start with simple $Z$ and predefine a criterion $\varepsilon$. If $F(w_1,w_2,\ldots,w_m) \leq \varepsilon$, proceed with that $Z$. Otherwise, try another. Modeling $Z$ is impossible without domain-specific knowledge.

Another advice is to consider other metaheuristic approaches. They do not perform the same on the same problem class or instances. Particle Swarm Optimization is a well-known metaheuristic for solving numerical optimization problems. If $w_i \in R$, ($i=1,2,\ldots,m$), your problem is such.