[NewPop] = SampleGaussianUnivModel(NumbVar,model,RangeValues,AuxPop,AuxFunVal,sampling_params) SampleGaussianUnivModel: Samples a population of individuals from a Gaussian univariate model INPUTS NumbVar: Number of variables model: model{1} = mean of the variables model{2} =variances of the variables RangeValues: Matrix of two vectors with the minimum and maximum real values each variable can take AuxPop: Auxiliary (selected) population (May be use for partial sampling or resampling) AuxFunVal: Evaluation of the data set (required for some sampling algorithms, not for this one) sampling_params{1,1} = N: Number of generated individuals OUTPUTS NewPop: Sampled individuals Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
0001 function [NewPop] = SampleGaussianUnivModel(NumbVar,model,RangeValues,AuxPop,AuxFunVal,sampling_params) 0002 % [NewPop] = SampleGaussianUnivModel(NumbVar,model,RangeValues,AuxPop,AuxFunVal,sampling_params) 0003 % SampleGaussianUnivModel: Samples a population of individuals from a Gaussian 0004 % univariate model 0005 % INPUTS 0006 % NumbVar: Number of variables 0007 % model: model{1} = mean of the variables 0008 % model{2} =variances of the variables 0009 % RangeValues: Matrix of two vectors with the minimum and maximum real values 0010 % each variable can take 0011 % AuxPop: Auxiliary (selected) population (May be use for partial sampling or resampling) 0012 % AuxFunVal: Evaluation of the data set (required for some sampling algorithms, not for this one) 0013 % sampling_params{1,1} = N: Number of generated individuals 0014 % OUTPUTS 0015 % NewPop: Sampled individuals 0016 % 0017 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es) 0018 0019 0020 PopSize = cell2num(sampling_params{1}(1)); 0021 0022 vars_means = model{1}; 0023 vars_sigmas = model{2}; 0024 0025 % Generate the new population 0026 NewPop = normrnd(repmat(vars_means,PopSize,1),repmat(vars_sigmas,PopSize,1)); 0027 0028 0029 return;