ACON
Home/Topics |
Commands
Assessment Functions
The string functions include:
F Iterated,
F_From_Catch_Pop_M,
Grow Model,
Kimura Chikuni,
PQEOS,
PQ_Model,
QEOS,
QFORJ2,
Slicer,
Thompson Bell,
QNorm, and
PNorm.
See An Introduction to Assessment Models
Using the ACON Environment, A User's Guide for more information on assessment models.
This command returns a F vector calculated using the Gulland approximation.
Estimated F values are limited to a maximum of 20.
- There are 4 parameters:
- pop - a vector containing population numbers for ages 2...n at year y+1.
- caa - a vector containing catch-at-age numbers for ages 1...n-1 at year y.
- maa - a vector containing the natural mortality rate at ages 1...n-1.
- iteration limit - an optional scalar defining the approximation difference to terminate the iteration.
result = F_Iterated(pop,caa,maa,iteration_limit);
pop = 65994.8 75453.4 18817.7 9326.62 5098.05 11284.3 4846.78 1357.07 473.473;
caa = 0 241 423 766 578 1164 885 527 210.;
maa = 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2;
fvec = F_Iterated(pop,caa,maa,0.001);
fvec
0 0.00288097 0.0200958 0.0714859 0.097355 0.0889658 0.152317 0.299336 0.335198
This command returns a F vector calculated from a catch vector, a population vector, and natural mortality.
Estimated F values are limited to a maximum of 20.
- There are 4 parameters:
- caa - a vector containing catch-at-age numbers for ages 1...n-1 at year y.
- pop - a vector containing population numbers for ages 1...n-1 at year y.
- maa - a vector containing the natural mortality rate at ages 1...n-1.
- iteration limit - an optional scalar defining the approximation difference to terminate the iteration.
result = F_From_Catch_Pop_M(caa,pop,maa,iteration_limit);
pop = 65994.8 75453.4 18817.7 9326.62 5098.05 11284.3 4846.78 1357.07 473.473;
caa = 0 241 423 766 578 1164 885 527 210.;
maa = 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2;
fvec = F_From_Catch_Pop_M(caa,pop,maa,0.001);
fvec
0 0.00353008 0.0251037 0.0948319 0.13332 0.120568 0.224037 0.552569 0.661529
This command constructs an population at age and length for a number of years. The lengths are symmetric beta functions which are defined between 0 and 1 and require a mean and a range.
- There are 10 parameters (the 1st 7 are input parameters, the last 3 are output parameters):
- lcs - a vector of length groups.
- meanrangem - a matrix of mean length at age (column 1), and range of mean length at age (column 2).
- ninitm - a vector of initial population numbers at age.
- eff - a vector of efforts for projections over a number of years.
- rstru - a vector of recruitments, one per year.
- mal - a matrix of m (natural mortality) at length and age.
- sal - a matrix of selectivity at length and age.
- nalm - an output matrix of population numbers at length, age, and year.
- calm - an output matrix of catch numbers at length, age, and year.
- falm - an output matrix of mortality at length, age, and year.
grow_model(lcs,meanrangem,ninitm,eff,rstru,mal,sal,nalm,calm,falm);
eff = seq(.1,.38,0.02);
ny = scalar(len(eff));
ninitm = 100. 81 65 51 40 31 23 17 13 9 ;
na = scalar(len(ninitm));
lcs = seq(100, 350. ,5);
midlcs = 0.5 * (drop(1,lcs) + drop(-1,lcs));
sela = min(1,0.0118 * exp(0.02 * midlcs));
wal = 0.00001 * pow(midlcs,3);
nl = scalar(len(lcs)) - 1;
mal = shape(cat(0,nl,na), 0.2);
sal = transpose(shape(cat(0,na,nl), sela));
rstru = 100. 101 500 116 84 108 79 124 300 82 94 77 84 78 96;
meanm = 135.4 189.6 226 250.4 266.7 277.7 285.1 289.9 293.3 295.5;
rangeh = 2 * 30. 30 20 20 20 20 20 20 20 20 ;
meanrangem = cat(2,meanm,rangeh);
falm = nalm = calm = shape(nl,na,ny,0.0);
// creates a population at age and length and year
grow_model(lcs,meanrangem,ninitm,eff,rstru,mal,sal,nalm,calm,falm);
This command converts catch at length matrix to catch at age matrix iteratively based on an age-length key template. The algorithm is from:
Kimura and Chikuni 1987. Mixtures of empirical distributions: an iterative application of the age-length key. Biometrics 43:23-35.
This command may be used when aged data are not available.
- There are 3 parameters:
- templ - a age-length key matrix containing normalized distributions as input.
- cal - a catch-at-length matrix supplied as the input data.
- caa - a catch-at-age matrix in which the calculated values are returned.
Kimura_Chikuni(templ,cal,caa);
templ
0.011654 0.000000 0.000000 0.000000 0.000000
0.093479 0.000000 0.000000 0.000000 0.000000
0.295815 0.000000 0.000000 0.000000 0.000000
0.372294 0.000000 0.000000 0.000000 0.000000
0.186676 0.012630 0.000000 0.000000 0.000000
0.037101 0.067257 0.000000 0.000000 0.000000
0.002893 0.194667 0.000000 0.000000 0.000000
0.000088 0.306851 0.000000 0.000000 0.000000
0.000001 0.263670 0.000000 0.000000 0.000000
0.000000 0.123467 0.044495 0.000000 0.000000
0.000000 0.031458 0.133806 0.000000 0.000000
0.000000 0.000000 0.246580 0.000000 0.000000
0.000000 0.000000 0.278638 0.027400 0.000003
0.000000 0.000000 0.193099 0.089054 0.000044
0.000000 0.000000 0.082035 0.188469 0.000470
0.000000 0.000000 0.021347 0.259858 0.003439
0.000000 0.000000 0.000000 0.233475 0.017190
0.000000 0.000000 0.000000 0.136685 0.058798
0.000000 0.000000 0.000000 0.052121 0.137709
0.000000 0.000000 0.000000 0.012937 0.220920
0.000000 0.000000 0.000000 0.000000 0.242821
0.000000 0.000000 0.000000 0.000000 0.182865
0.000000 0.000000 0.000000 0.000000 0.094343
0.000000 0.000000 0.000000 0.000000 0.033334
0.000000 0.000000 0.000000 0.000000 0.008063
cal
12.350967 16.490069 17.132339
19.742212 5.675348 13.207279
18.504662 1.999938 9.820754
16.274118 13.068861 1.425701
16.990380 16.544176 5.678334
1.772372 3.325053 6.878850
0.849311 11.605395 7.964611
4.749693 6.812067 8.051098
0.216226 4.843235 11.384606
12.524166 2.735227 18.729224
19.315953 19.190281 12.111431
9.247445 12.831046 0.451626
7.042661 2.188369 13.870002
8.581534 9.588117 1.948371
19.032998 6.845767 7.959784
12.916559 17.160732 10.014539
12.420900 9.788773 5.786544
1.041029 8.051331 5.735117
18.632764 1.397162 8.965811
5.900131 11.534220 16.931442
9.771202 1.239230 17.139395
3.777296 11.771582 17.942704
19.336412 10.529564 18.643380
17.814955 2.978192 17.907940
9.117310 15.441406 19.118164
// Kimura_Chikuni - used to convert catch at length to catch at age when aged data are not available
Kimura_Chikuni(templ,cal,ctem); // Convert the Catch-at-length to Catch-at-age
ctem
85.186161 55.269176 49.497304
11.991076 29.387860 50.378610
56.742017 43.357455 31.480068
40.222255 36.663305 21.199044
83.781747 58.957344 122.244019
This command calculate F (fishing mortality) using the Gulland approximation. It estimates the F values
iteratively Gulland and returns a vector of F values for the current year and ranges of ages.
- There are 4 parameters:
- popv - numeric vector of population numbers for the subsequent year and a range of
ages (1 year older in the subsequent year , typically 2...number of ages).
- caa - numeric vector of catch numbers for the current year and a range of ages (typically 1.. number of ages-1).
- maa - numeric vector of natural mortality estimates for the current year and a range of ages (typically 1.. number of ages-1).
- iteration limit - tolerance value to use to limit the number of iterations (default 0.001).
F_Iterated(popv, caa, maa, iteration_limit);
F_Iterated(popv, caa, maa, iteration_limit);
/* example extalk syntax: */
iage = seq(1,na-1);
fmat[iage;y] = F_Iterated(pop[iage + 1;y + 1], caa[iage;y], maa[iage], 0.001); /* iteration-limit is optional - default is 0.001 */
This command specifies the parameters of the PQEOS
VPA model. This model is an age based model using index ages for
f on the last year and algebraically estimated q´s. Parameters used to fit the model are
log(population numbers) in the last year.
Differences of the log(observed) - log(estimated)[q adjusted] population numbers,
biomass, or F are calculated as residuals. This model is identical to QEOS except that
more than one annual observation is allowed.
- There are 18 parameters:
- catch - the annual catch at age as a matrix (ages x years).
- waa - Jan. 1st weight at age matrix (ages x years).
- vselmod - selectivity at age vector (nages).
- vcode - coding matrix describing the tuning data (nindices x 5).
- vdat - tuning data matrix (nindices x nyears).
- maa - natural mortality as a vector or matrix (ages x years).
- fagi - index ages vector (ages for which the f´s in the terminal year are estimated).
- logflag - flag to use log residuals.
- pop - the resultant population numbers matrix (ages x years).
- fmat - the resultant f matrix (ages x years).
- bmat - the resultant population biomass matrix (ages x years).
- par - the parameters being estimated [log population numbers in the last year] (nfagi).
- qest - the scaling factors between the observed and population estimates being estimated (nindices).
- resid - the residuals begin estimated.
- oldagei - the age(s) from which the f estimates for the oldest age are derrived.
- yrfrac - the fraction of a year for which the last year´s catch represents
- vpaflag - flag to iterate to a stable f values.
- period - the period of observations. e.g. 4 = quarterly estimates.
PQEOS(catch, waa, selmod, vcode, vdat, maa, fagi, logflag, pop, fmat, bmat, par, qest, resid, oldagei, yrfrac, vpaflag, period);
This command specifies the parameters of the PQModel
VPA model. This model is an age based model using index ages for
f on the last year and estimated q´s.
- There are 16 parameters:
- catch - the total annual catch as a vector.
- waa - wt at age matrix.
- selmod -selectivity at age vector.
- termf -terminal f vector.
- vcode -coding matrix describing the tuning data.
- vdat -tuning data matrix.
- maa -natural mortality as a vector or matrix.
- fagi -index ages vector.
- logflag - flag to use log residuals.
- pop - the resultant population numbers matrix (ages x years).
- fmat - the resultant f matrix (ages x years).
- bmat - the resultant population biomass matrix (ages x years).
- par - the parameters being estimated.
- resid - the residuals begin estimated.
- iteratef - 1 = iterate to a stable f matrix, 2 = using the LSmodel.
- period - the period of the catch data. e.g. 4 = quarterly catch at age data.
PQModel(catch, waa, selmod, termf, vcode, vdat, maa, fagi, logflag, pop, fmat, bmat, par, qest, resid, iteratef, period);
This command specifies the parameters of the QEOS
VPA model. This model is an age based model using index ages for
f on the last year and algebraically estimated q´s. Parameters used to fit the model are
log(population numbers) in the last year.
Differences of the log(observed) - log(estimated)[q adjusted] population numbers,
biomass, or F are calculated as residuals.
- There are 17 parameters:
- catch - the annual catch at age as a matrix (ages x years).
- waa - Jan. 1st weight at age matrix (ages x years).
- selmod - selectivity at age vector (nages).
- vcode - coding matrix describing the tuning data (nindices x 5).
- vdat - tuning data matrix (nindices x nyears).
- maa - natural mortality as a vector or matrix (ages x years).
- fagi - index ages vector (ages for which the f´s in the terminal year are estimated).
- logflag - flag to use log residuals.
- vpop - the resultant population numbers matrix (ages x years).
- fmat - the resultant f matrix (ages x years).
- bmat - the resultant population biomass matrix (ages x years).
- par - the parameters being estimated [log population numbers in the last year] (nfagi).
- qest - the scaling factors between the observed and population estimates being estimated (nindices).
- resid - the residuals begin estimated.
- oldagei - the age(s) from which the f estimates for the oldest age are derrived.
- yrfrac - the fraction of a year for which the last year´s catch represents
- vpaflag - flag to iterate to a stable f values.
QEOS(catch, waa, selmod, vcode, vdat, maa, fagi, logflag, pop, fmat, bmat, par, qest, resid, oldagei, yrfrac, vpaflag);
This command specifies the parameters of the QFORJ2
VPA model. This model is an forward projection age based model using index ages for
f on the last year and algebraically estimated q´s. Parameters used to fit the model are
log(population numbers) in the last year.
Differences of the log(observed) - log(estimated)[q adjusted] population numbers,
biomass, or F are calculated as residuals.
- There are 18 parameters:
- catch - the annual catch at age as a matrix (ages x years).
- waa - Jan. 1st weight at age matrix (ages x years).
- selmod - selectivity at age vector (nages).
- vcode - coding matrix describing the tuning data (nindices x 5).
- vdat - tuning data matrix (nindices x nyears).
- maa - natural mortality as a vector or matrix (ages x years).
- fagi - index ages vector (ages for which the f´s in the terminal year are estimated).
- logflag - flag to use log residuals.
- globsurv - tuning survey used to estimate q (ages x years) for years after the reference year.
- refyr - reference year.
- vpop - the resultant population numbers matrix (ages x years).
- fmat - the resultant f matrix (ages x years).
- bmat - the resultant population biomass matrix (ages x years).
- par - the parameters being estimated [log population numbers in the last year] (nfagi).
- qest - the scaling factors between the observed and population estimates being estimated (nindices).
- resid - the residuals begin estimated.
- yhatm - the resultant estimated population matrix for the estimated ages adjusted for time of year (estimated ages x years).
- oldagei - the age(s) from which the f estimates for the oldest age are derrived.
- yrfrac - the fraction of a year for which the last year´s catch represents
- vpaflag - flag to iterate to a stable f values.
QFORJ2(catch, waa, selmod, vcode, vdat, maa, fagi, logflag, globsurv, refyr, pop, fmat, bmat, par, qest, resid, yhatm, oldagei, yrfrac, vpaflag);
This command converts catch at length matrix to catch at age matrix using cohort slicing.
This command may be used when aged data are not available.
- There are 4 parameters:
- lcs - a vector of length classes as input.
- mnlaa - a vector of as input.
- cal - a catch-at-length matrix supplied as the input data.
- caa - a catch-at-age matrix in which the calculated values are returned.
Slicer(lcs,mnlaa,cal,caa);
lcs = seq(2.5,52.5,2); // Length classes
mnlaa = 9 18.0 27.0 34.0 43.0 // Mean lengths-at-age
cal
12.350967 16.490069 17.132339
19.742212 5.675348 13.207279
18.504662 1.999938 9.820754
16.274118 13.068861 1.425701
16.990380 16.544176 5.678334
1.772372 3.325053 6.878850
0.849311 11.605395 7.964611
4.749693 6.812067 8.051098
0.216226 4.843235 11.384606
12.524166 2.735227 18.729224
19.315953 19.190281 12.111431
9.247445 12.831046 0.451626
7.042661 2.188369 13.870002
8.581534 9.588117 1.948371
19.032998 6.845767 7.959784
12.916559 17.160732 10.014539
12.420900 9.788773 5.786544
1.041029 8.051331 5.735117
18.632764 1.397162 8.965811
5.900131 11.534220 16.931442
9.771202 1.239230 17.139395
3.777296 11.771582 17.942704
19.336412 10.529564 18.643380
17.814955 2.978192 17.907940
9.117310 15.441406 19.118164
Slicer(lcs,mnlaa,cal,ctem2); // Convert the Catch-at-length to Catch-at-age
ctem2
84.748526 55.440919 50.703831
19.225581 27.658450 49.568963
44.187593 43.797814 28.381430
45.411486 41.846602 29.495983
84.350071 54.891356 116.648838
This command performs a Yield per recuit analysis based on the Thompson Bell YPR model.
- There are 9 parameters:
- sel -selectivity vector.
- waa - wt at age vector.
- matage - natural mortality at age vector.
- compflag - complete age structure flag.
- frange - the f value at which to evaluate the yield.
- yield - the resultant yield vector.
- biomass - the resultant biomass vector.
- f01 - the resultant vector to store f0.1 (2 elements).
- y01 - the resultant vector to store yield0.1 (2 elements).
Thompson_Bell(sel, watage, matage, compflag, frange, yield, biomass, f01max, y01max);
frange = 0. 0.0001 0.0002 0.1 .2 .3 .4 .5 .6 .7 .8 .9 1.0 1.1 1.2;
yield = biomass = shape(len(frange),0.0);
f01max = y01max = 0.0 0.0;
selin = .0001 .0002 .014 .156 .48 .74 .951 1. 1. 1. 1. 1. 1. 1. 1.;
wt9440 = 100. 290 660 840 1070 1390 1710 2000 2790 2910 4380 3640 6940 13320 12090
na = len(selin);
maa = shape(na,0.2);
Thompson_Bell(selin,wt9440,maa,0,frange,yield,biomass,f01max,y01max);
Data_Viewport(mm(30),mm(150),mm(200),mm(250));
plot_lines(frange,yield,cat("Yield at F0.1 and Fmax = ",str(int(y01max))));

This command returns the Normal deviate Z of a given lower tail area of P. The code
used for this function was translated from FORTRAN code which implemented
algorithm AS241 from Appl. Statist. (1988) Vol. 37, No. 3, pg 477-484.
Z is accurate to about 1 part in 10**7.
The inverse function of this command is
PNorm(x).
- There is 1 parameter:
- x - a scalar, vector, or matrix containing area(s) for which the normal deviate Z is required.
QNorm(x);
QNorm(.2);
-0.841621
This command returns the tail area of the standardized normal curve having a mean of 0.0
and standard deviation of 1.0.
The code used for this function was translated from FORTRAN code which implemented
algorithm AS66 from Appl. Statist. (1973) Vol. 22, No. 3.
The inverse function of this command is
QNorm(x).
- There is 1 parameter:
- x - a scalar, vector, or matrix containing normal deviate(s) for which the area is required.
PNorm(x);
PNorm(-0.841621); .2
ACON
Home/Topics |
Commands
|