# garegr2

Calculates least squares estimates using Nelder Mead's simplex method for bivariate data

## Contents

## Syntax

[q,info,endPop,bPop,traceInfo] = **garegr2**(func, p, x, y, Z, W)

## Description

Calculates least squares estimates using Nelder Mead's simplex method for bivariate data

Input

- func: string with name of user-defined function

f = func (p, x, y) with p: np-vector; x: nx-vector; y: ny-vector f: (nx,ny)-matrix with model-predictions for dependent variable

- p: (np,2) matrix with

p(:,1) initial guesses for parameter values p(:,2) binaries with yes or no iteration (optional)

- x: (nx,1)-vector with first independent variable
- y: (ny,1)-vector with second independent variable
- Z: (nx,ny)-matrix with dependent variable
- W: (nx,ny)-matrix with weight coefficients (optional)

Output

- q: matrix like p, but with least squares estimates
- 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 **nrregr2**, but slower and a larger bassin of attraction. garegr2 calls for: User-defined function: 'func'

Crossover Operators: simplexover heuristicxover arithxover Mutation Operators: boundarymutation multinonunifmutation nonunifmutation unifmutation Selection Functions: normgeomselect roulette tournselect Option setting: garegr_options

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

## Example of use

See **mydata_regr2**