garegr
Calculates least squares estimates using a genetic algorithm
Contents
Syntax
[q, info, endPop, bPop, traceInfo] = garegr(func, p, varargin)
Description
Calculates least squares estimates using a genetic algorithm
Input
- func: string with name of user-defined function
f = func (p, xyw) with p: k-vector with parameters; xyw: (n,c)-matrix; f: n-vector [f1, f2, ...] = func (p, xyw1, xyw2, ...) with p: k-vector and xywi: (ni,k)-matrix; fi: ni-vector with model predictions The dependent variable in the output f; For xyw see below.
- p: (k,4) matrix with
p(:,1) initial guesses for parameter values (not used) p(:,2) binaries with yes or no iteration p(:,[2 3]) boundaries for iterated parameters
- xywi (read as xyw1, xyw2, .. ): (ni,3) matrix with
xywi(:,1) independent variable i xywi(:,2) dependent variable i xywi(:,3) weight coefficients i (optional) xywi(:,>3) data-point specific information data (optional) The number of data matrices xyw1, xyw2, ... is optional but >0
Output
- q: matrix like p, but with least squares estimates in first column
- info: 1 if convergence has been successful; 0 otherwise
- endPop: the final population: individual in each row; last column is minus weighted sum of squares
- bPop: a trace of the best population
- traceInfo: a matrix of best and means of the ga for each generation
Remarks
Set options with garegr_options. Similar to nrregr, but slower and a larger bassin of attraction.
Modified from gaot package version 1996/02/02: C.R. Houck, J.Joines, and M.Kay. A genetic algorithm for function optimization: A Matlab implementation. ACM Transactions on Mathmatical Software, Submitted 1996; binary and order options removed
garegr calls for: User-defined function: 'func' Crossover Operators: simplexover heuristicxover arithxover Mutation Operators: boundarymutation multinonunifmutation nonunifmutation unifmutation Selection Functions: normgeomselect roulette tournselect Utility functions: cat
Example of uss
See mydata_regr