Class Summary Class Description FormulaFitnessFunction Fitness function for evaluating the produced fomulas, represented as GP programs.SymProblem Initialize the problem.SymRegression Perform symbolic regression.

## Package jhpro.sregression Description

## Symbolic regression based on JGAP

#### Supported function

The program has support for the following functions from JGAP. The "main" type is double so all functions are not applicable there (e.g.`IfElse`

etc). However, for the ADF functions (defined by setting `adf_arity`

to > 0) many more functions is supported. Please note that some of these are (very) experimental and maybe don't even make sense in this context.-
`Multiply`

(double) -
`Multiply3`

(double) -
`Add`

(double) -
`Add3`

(double) -
`Add4`

(double) -
`Divide`

(double) -
`Subtract`

(double) -
`Sine`

(double) -
`ArcSine`

(double) -
`Tangent`

(double) -
`ArcTangent`

(double) -
`Cosine`

(double) -
`ArcCosine`

(double) -
`Exp`

(double) -
`Log`

(double) -
`Abs`

(double) -
`Pow`

(double) -
`Round`

(double) -
`Ceil`

(double) -
`Floor`

(double) -
`Modulo`

(double), implements Java's`%`

operator for double. See ModuloD for a variant -
`Max`

(double) -
`Min`

(double) -
`LesserThan`

(boolean) -
`GreaterThan`

(boolean) -
`If`

(boolean) -
`IfElse`

(boolean) -
`IfDyn`

(boolean) -
`Loop`

(boolean) -
`Equals`

(boolean) -
`ForXLoop`

(boolean) -
`ForLoop`

(boolean) (cf the double variant ForLoopD) -
`Increment`

(boolean) -
`Pop`

(boolean) -
`Push`

(boolean) -
`And`

(boolean), cf the double variant AndD -
`Or`

(boolean), cf the double variant OrD -
`Xor`

(boolean), cf the double variant XorD -
`Not`

(boolean), cf the double variant NotD -
`SubProgram`

(boolean) -
`Tupel`

(boolean)

#### Examples

Here are two small examples of the program, including the configuration file and a sample run.**Polynom**

Here is a simple example of a configuration file. It happens to be the same problem as the JGAP example MathProblem, the

**polynom x^4 + x^3 + x^2 - x**.

## Polynom x^4 + x^3 + x^2 - x# The JGAP example#presentation: P(4) x^4 + x^3 + x^2 - x (the JGAP example)num_input_variables: 1variable_names: x yfunctions: Add,Subtract,Multiply,Divide,Pow,Log,Sineterminal_range: -10 10max_init_depth: 4population_size: 1000max_crossover_depth: 8num_evolutions: 800max_nodes: 20stop_criteria_fitness: 0.1data-2.378099 26.5674954.153756 382.457432.6789956 75.234815.336802 986.337772.4132318 51.379707-1.7993588 9.6939333.9202332 307.87752.9227705 103.56364-0.1422224 0.1599824.9111285 719.395451.2542424 4.766681.5987749 11.5774564.7125554 615.356-1.1101999 2.493538-1.7379236 8.6318023.8303614 282.296975.158349 866.72223.6650343 239.429340.3196721 -0.17437163-2.3650131 26.014963A simple run example:

It was 20 data rowsPresentation: P(4) x^4 + x^3 + x^2 - x (the JGAP example)output_variable: y (index: 1)input variable: xfunction1: &1 + &2function1: &1 - &2function1: &1 * &2function1: /function1: &1 ^ &2function1: log &1function1: sine &1function1: 1.0[19:52:57] INFO GPGenotype - Creating initial population[19:52:57] INFO GPGenotype - Mem free: 10.5 MB[19:52:57] INFO GPPopulation - Prototype program set[19:52:57] INFO GPGenotype - Mem free after creating population: 10.5 MBCreating initial populationMem free: 10.5 MBEvolving generation 1/800, memory free: 6.7 MB (time from start: 0,42s)Best solution fitness: 968.56Best solution: x ^ 4.0Correlation coefficient: 0.9999999999999939Fitness stopping criteria (0.1) reached with fitness 3.7509724195622374E-4 at generation 23All time best (from generation 23)Evolving generation 23/800, memory free: 10.4 MB (time from start: 3,20s)Best solution fitness: 3.7509724195622374E-4Best solution: (x * ((((x * x) + x) * x) + x)) - xDepth of chrom: 6Correlation coefficient: 0.9999999999999939Total time 3,20s

**SCaVis 2.1 © jWork.ORG**