Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorial:heuristic_calibration_of_models_by_using_genetic_algorithm [2013/08/14 20:14]
admin
tutorial:heuristic_calibration_of_models_by_using_genetic_algorithm [2019/08/23 13:36] (current)
argemiro
Line 1: Line 1:
 +{{ :​logo_logo.png?​400 |}}
 +\\
 +\\
 +\\
 ====== ​ Heuristic calibration of models by using Genetic Algorithm ​ ====== ====== ​ Heuristic calibration of models by using Genetic Algorithm ​ ======
    
Line 11: Line 15:
  
  
-The //​[[:​Genetic Algorithm Tool|Genetic Algorithm (GA) Tool]]// provides a powerful means of calibrating environmental models[[http://​dx.doi.org/​10.1016/​j.envsoft.2013.01.010|( Soares Filho et al., 2013)]]. By mimicking the principle of biological evolution (Koza, 1992), GA tool uses massive computing and heuristics to seek for a global optimum solution for a set of model parameters. Dinamica EGO´s GA tool consists of a container, which requires the placement of a sequence of functors within it and, in particular, of two associated functors: //[[:Get Current Individual]]//​ and //[[:Set Fitness]]//​. Fig. 1 depicts a model calibration scheme using GA tool. First, one needs to get the coefficients from the model parameters to be calibrated and assemble these coefficients in tables. Thus each model parameter will represent an allele in a table that corresponds to a gene. In turn, these tables are assembled by using //[[:Create Lookup Table]]// Group in a group of tables to form a chromosome. This group of tables is an input to GA tool. GA tool spawns a population based on the genotype passed in a group table. Inside GA tool, //[[:Get Current Individual]]//​ is placed to get the genes from the individuals of a generation. Other functors, such as //​[[:​Extract Lookup Table from Lookup Table Group]]//, are sequenced to catch the parameter coefficients and pass them to the model, which is executed once per individual. An evaluation function is coupled to the output of the model and its result is passed to //[[:Set Fitness]]//,​ which returns the fitness value to GA tool for the selection process. The internal sequence of functors will iterate a number of times equal to the number of individuals multiplied by generations,​ as specified in GA tool´s input ports. When GA tool terminates, it will output the fitness of the overall best individual as well as the group of tables that comprises its genes. ​+The //​[[:​Genetic Algorithm Tool|Genetic Algorithm (GA) Tool]]// provides a powerful means of calibrating environmental models[[http://​dx.doi.org/​10.1016/​j.envsoft.2013.01.010|( Soares Filho et al., 2013)]]. By mimicking the principle of biological evolution (Koza, 1992), GA tool uses massive computing and heuristics to seek for a global optimum solution for a set of model parameters. Dinamica EGO´s GA tool consists of a container, which requires the placement of a sequence of functors within it and, in particular, of two associated functors: //[[:Get Current Individual]]//​ and //[[:Set Fitness]]//​. Fig. 1 depicts a model calibration scheme using GA tool. First, one needs to get the coefficients from the model parameters to be calibrated and assemble these coefficients in tables. Thus each model parameter will represent an allele in a table that corresponds to a gene.  
 +\\ 
 +\\ 
 +In turn, these tables are assembled by using //[[:Create Lookup Table]]// Group in a group of tables to form a chromosome. This group of tables is an input to GA tool. GA tool spawns a population based on the genotype passed in a group table. Inside GA tool, //[[:Get Current Individual]]//​ is placed to get the genes from the individuals of a generation. Other functors, such as //​[[:​Extract Lookup Table from Lookup Table Group]]//, are sequenced to catch the parameter coefficients and pass them to the model, which is executed once per individual. An evaluation function is coupled to the output of the model and its result is passed to //[[:Set Fitness]]//,​ which returns the fitness value to GA tool for the selection process. The internal sequence of functors will iterate a number of times equal to the number of individuals multiplied by generations,​ as specified in GA tool´s input ports. When GA tool terminates, it will output the fitness of the overall best individual as well as the group of tables that comprises its genes. ​
  
    
Line 20: Line 27:
 First, load the model ''​Cal_Reciprocal_fitness1x1.ego''​ from ''​\ Examples\ Genetic_Algorithm\WEofE''​. This model calculates the reciprocal fitness of a deforestation model that was calibrated using the Weights of Evidence method – a soft predictor. Run the model and access its output ''​Reciprocal_fitness1x1.csv''​ using either a spreadsheet or enabling table viewer on the output port of Set Key 1. The concept of this validation measure is provided in sixth  and seventh chapters of lesson [[tutorial:​building_a_land-use_and_land-cover_change_simulation_model|Building a Land use and Land-cover Change Simulation Model]]. The fitness obtained for this model is 0.2060. Open the Weights of Evidence tables in ''​originals\tables''​ and their corresponding maps in ''​originals\maps''​ under the folder ''​Genetic_Algorithm''​. In this model, //​[[:​Calculate Map]]// replaces //​[[:​calc_w._of_e._probability_map|Calc W. E. Probability Map]]//. Open it to see the equation that integrates the weights of evidence to produce the transition probability map. The weights of evidence coefficients are input as separate tables, so they can form a group of table and thereby the gene. First, load the model ''​Cal_Reciprocal_fitness1x1.ego''​ from ''​\ Examples\ Genetic_Algorithm\WEofE''​. This model calculates the reciprocal fitness of a deforestation model that was calibrated using the Weights of Evidence method – a soft predictor. Run the model and access its output ''​Reciprocal_fitness1x1.csv''​ using either a spreadsheet or enabling table viewer on the output port of Set Key 1. The concept of this validation measure is provided in sixth  and seventh chapters of lesson [[tutorial:​building_a_land-use_and_land-cover_change_simulation_model|Building a Land use and Land-cover Change Simulation Model]]. The fitness obtained for this model is 0.2060. Open the Weights of Evidence tables in ''​originals\tables''​ and their corresponding maps in ''​originals\maps''​ under the folder ''​Genetic_Algorithm''​. In this model, //​[[:​Calculate Map]]// replaces //​[[:​calc_w._of_e._probability_map|Calc W. E. Probability Map]]//. Open it to see the equation that integrates the weights of evidence to produce the transition probability map. The weights of evidence coefficients are input as separate tables, so they can form a group of table and thereby the gene.
  
-Now, open ''​GAReciprocal_fitness1x1.ego''​ from ''​Genetic_Algorithm\GAknn\Reciprocal_fitness1x1''​. Compare the structure of this model with the diagram from Fig.1. Open GA tool. This container envelops three //[[:Groups]]// and two functors. //[[:Get Current Individual]]//​ obtains the gene of an individual pertaining to a generation and passes it to a sequence of functors that extract the lookup tables that compose the gene. A land change simulation model receives those tables as input and its execution results are passed to a fitness function that assesses its spatial performance. In turn, this function returns the fitness measure that is caught and passed to GA tool by //[[:Set Fitness]]//​. ​+Now, open ''​GAReciprocal_fitness1x1.ego''​ from ''​Genetic_Algorithm\GAknn\Reciprocal_fitness1x1''​. Compare the structure of this model with the diagram from Fig.1. Open GA tool. This container envelops three //[[:Group]]//and two functors. //[[:Get Current Individual]]//​ obtains the gene of an individual pertaining to a generation and passes it to a sequence of functors that extract the lookup tables that compose the gene. A land change simulation model receives those tables as input and its execution results are passed to a fitness function that assesses its spatial performance. In turn, this function returns the fitness measure that is caught and passed to GA tool by //[[:Set Fitness]]//​. ​
  
 {{ :​tutorial:​ga_2.jpg |}} {{ :​tutorial:​ga_2.jpg |}}