Home > Mateda2.0 > statistics > simple_pop_statistics.m

# simple_pop_statistics

## PURPOSE

[AllStat] = simple_pop_statistics(k,Pop,FunVal,time_operations,number_evaluations,AllStat,statistics_params)

## SYNOPSIS

function[AllStat] = simple_pop_statistics(k,Pop,FunVal,time_operations,number_evaluations,AllStat,statistics_params)

## DESCRIPTION

     [AllStat] = simple_pop_statistics(k,Pop,FunVal,time_operations,number_evaluations,AllStat,statistics_params)
     simple_pop_statistics:  Computes relevant statistics about EDA in each
                             generation and stores it in AllStat

     INPUTS
     k:                   Current generation
     Pop:                 Current population
     FunVal:              A matrix of function evaluations, one vector of m objectives for each individual
     time_operations(1:k,1:6):  Matrix with the time in seconds spent at the main
                          EDA steps, each of the 8 column stores the times for the
                          following steps {sampling, repairing, evaluation, local optimization, replacement, selection,learning and
                          total (which consider the time by the previous 7 and
                          other EDA operations)

     number_evaluations(1:k):  Vector with the number of evaluations in each generation
     AllStat:             Array containing the statistics of the populations.
                          It is updated by the method
                          AllStat{k,1}= matrix of 7 rows and number_objectives
                          columns. Each row shows information about
                          max,mean,median,min, and variance values of the
                          corresponding objective in the current population
                          AllStat{k,2}= Stores the best individual
                          AllStat{k,3}= Number of different individuals
                          AllStat{k,4}= matrix of 5 rows and n
                          columns. Each row shows information about
                          max,mean,median,min, and variance values of the
                          corresponding variable in the current population
                          AllStat{k,5} = number_evaluations(k,:) (see inputs)
                          AllStat{k,6} = time_operations(k,:) (see inputs)
     statistics_params(1): find_bestinds_method: Name of the procedure for selecting the  best individuals
                                                     from a population (by default is 'fitness_ordering')
     OUTPUTS
     AllStat: Array containing the statistics of the population

     Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function[AllStat] = simple_pop_statistics(k,Pop,FunVal,time_operations,number_evaluations,AllStat,statistics_params)
    0002 % [AllStat] = simple_pop_statistics(k,Pop,FunVal,time_operations,number_evaluations,AllStat,statistics_params)
    0003 % simple_pop_statistics:  Computes relevant statistics about EDA in each
    0004 %                         generation and stores it in AllStat
    0005 %
    0006 %
    0007 %
    0008 %
    0009 % INPUTS
    0010 % k:                   Current generation
    0011 % Pop:                 Current population
    0012 % FunVal:              A matrix of function evaluations, one vector of m objectives for each individual
    0013 % time_operations(1:k,1:6):  Matrix with the time in seconds spent at the main
    0014 %                      EDA steps, each of the 8 column stores the times for the
    0015 %                      following steps {sampling, repairing, evaluation, local optimization, replacement, selection,learning and
    0016 %                      total (which consider the time by the previous 7 and
    0017 %                      other EDA operations)
    0018 %
    0019 % number_evaluations(1:k):  Vector with the number of evaluations in each generation
    0020 % AllStat:             Array containing the statistics of the populations.
    0021 %                      It is updated by the method
    0022 %                      AllStat{k,1}= matrix of 7 rows and number_objectives
    0023 %                      columns. Each row shows information about
    0024 %                      max,mean,median,min, and variance values of the
    0025 %                      corresponding objective in the current population
    0026 %                      AllStat{k,2}= Stores the best individual
    0027 %                      AllStat{k,3}= Number of different individuals
    0028 %                      AllStat{k,4}= matrix of 5 rows and n
    0029 %                      columns. Each row shows information about
    0030 %                      max,mean,median,min, and variance values of the
    0031 %                      corresponding variable in the current population
    0032 %                      AllStat{k,5} = number_evaluations(k,:) (see inputs)
    0033 %                      AllStat{k,6} = time_operations(k,:) (see inputs)
    0034 % statistics_params(1): find_bestinds_method: Name of the procedure for selecting the  best individuals
    0035 %                                                 from a population (by default is 'fitness_ordering')
    0036 % OUTPUTS
    0037 % AllStat: Array containing the statistics of the population
    0038 %
    0039 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0040
    0041 find_bestinds_method = char(cellstr(statistics_params{1}(1)));
    0042
    0043          AllStat{k,1} =  [max(FunVal);  % Statistics of the fitness objectives
    0044                           mean(FunVal);
    0045                           median(FunVal);
    0046                           min(FunVal);
    0047                           var(FunVal)];
    0048
    0049         [Ind]  = eval([find_bestinds_method,'(Pop,FunVal)']);  % The  best individual is found
    0050
    0051         AllStat{k,2} = Pop(Ind(1),:);                                % Best individual
    0052         AllStat{k,3} = size(unique(Pop,'rows'),1);                % Number of different individuals
    0053
    0054
    0055         AllStat{k,4} =   [max(Pop);              % Statistics of the population
    0056                           mean(Pop);
    0057                           median(Pop);
    0058                           min(Pop);
    0059                           var(Pop)];
    0060
    0061        AllStat{k,5} = number_evaluations(k);
    0062        AllStat{k,6} = time_operations(k,:);
    0063
    0064
    0065
    0066 return;
    0067