ABSTRACT

One of the more important aspects of modelling in ecology and fisheries science relates to the fitting of models to data. In Microsoft Excel, when fitting models to data, the optimum model parameters are found using the built-in Excel Solver. This involves setting up a spreadsheet so that the criterion of optimum fit (sum-of-squares, maximum likelihood, etc., see below) is represented by the contents of a single cell, and the model parameters and data used were contained in other inter-related cells. This chapter focuses on how to set-up R code to enable model parameter estimation using either least-squares or maximum likelihood, especially the latter. It illustrates the model fitting process through repeated examples and associated explanations. Fitting a model to data simply means estimating the model’s parameters so that its predictions match the observations as well as it can according to the criterion of best-fit chosen.