Toolbox: lib/pet

Routines for the add_my_pet collection. The aim is to


Load the following files from this subdirectory in the editor, while pwd is in the location where you want to work. You subsequently edit these files, replacing my_pet by the latin name of your species (genus and species in the name connected by an underscore), store them in your workspace and type run_my_pet in the active window. Make sure that the path to DEBtool_M and its subdirectories has been set.

Depending on option settings, results will be printed to screen and/or a .mat file and/or .html file. This .mat file can be read with printmat('my_pet'). You can start parameter estimation from an automized setting, the initial setting as specified in pars_init_my_pet (default), or from the results_my_pet.mat file, which was written after a previous run. You can reduce or enhance the effect of particular data sets/points by changing weight coefficients in mydata_my_pet. The function parscomp_st is used in predict files to compute compound parameter from primary parameters; most DEBtool/animal functions work with scaled parameters. The script run_my_pet first checks the consistency of the three user-defined functions with check_my_pet, assuming that they have no Matlab errors. Then estimation-options are set, such as the maximum number of iterations, or no estimation at all. Finally the estimation and automatized presentation of results are called; the presentation of results can (optionally) be customized with function custom_results_my_pet. Plots with the same labels and units can be combined into one plot, by assigning datasets to a group and setting a caption.

Once the parameters are known, function statistics_st and be used to evaluate implied properties. The general idea is that these properties can be checked for realism, and if some seem unrealistic, realistic values can be added to the mydata and predict-files and parameters re-estimated.

A detailed account of the method is presented in the add_my_pet estimation Wiki manual

For curators only

The core code estim_pars is a macro around regression function petregr_f (with filters or petregr without; model-specific filters prevent the estimation process to sample outside the allowed parameter space); options can be set with estim_options. Fix or release settings of parameters and chemical parameters are always taken from pars_init_my_pet; the parameters values might be set by get_pars if estim_options('pars_init_method', 0) (and parameters are free, not fixed) or are set by results_my_pet.mat if estim_options('pars_init_method', 1). The function matisinit can be used to check if the values in results_my_pet.mat equal those in pars_init_my_pet. If so, the .mat file was not produced via estim_pars and method-option 0 was used in combination with output-option 1 or 2.
This regression function uses filters for the various models, such as filter_std, while warnings are specified by e.g. warning_std. Filter holds are reported by print_filterflag in estim_pars. Customized filters can be build into the predict-file, directly after unpacking of inputs, by conditionally emptying output Prd_data, setting info = 0 and return.
Weight coefficients are set by setweights. Relative errors are computed by mre_st; These means are about the absolute values of the relative errrors.
Pseudodata are data that are (simple functions of) parameter values, while data and their predictions still might differ. They are used to avoid unrealistic values for poorly determined parameters. Pseudodata is added with addpseudodata, removed by rmpseudodata and predicted by predict_pseudodata.
automized initial estimates
Automized initial parameters estimates are generated with get_pars, which is a macro around get_pars_2 till 9. Specific density of biomass is set by get_d_V on the basis of taxonomic relationship.
several species
The code allows for parameter estimation of several species simultaneously. The function mydata_pets catenates mydata files, predict_pets catenates predict files, and result_pets does the same with results files.
Back to the DEBtool page