File format for submitting job to the test platform of POPAN. The theory is described in Schwarz, C.J. and Arnason, A.N. (1996) A general methodology for the analysis of capture-recapture experiments in open populations. Biometrics, 52, 860-873 Running the program: Type carlan. The program will prompt you for the name of a data file and an output file. Note that this standalone program does not allow all of the constraints that are possible in POPAN, e.g. gross births equal over time, unless the user writes a special subroutine. Several input sets may be stacked together; the program will process each one in turn. This is useful for simulations where another program can generate the input sets. CARLAN will analyze each simulation, and then another program can reads the results from CARLAN and produce summary statistics about the simulations. Error checking is MINIMAL. In particular, you must ensure that - all m(i) are > 0 in an unrestricted model (i>1). - all r(i) are > 0 in an unrestricted model (i0 will replace those set by the program automatically. Hence use a negative number to let the program choose an initial estimates. ------------------------- Other issues --------------------------- PARAMETER NON-IDENTIFIABILITY: The completely unrestricted model (p(g*t), phi(g*t), b(g*t)) has a non-identifiability problem as outlined in the paper cited above: p(nsamp)*phi(nsamp-1) cannot be separated p(1)*b(0) cannot be separated function(b(1),p(1),phi(1)) cannot be separated. This has implications for counting the number of parameters and for model fitting. In model 'g*t g*t g*t', the restrictions p(1)=p(nsamp)=1 are automatically set which implies that phi(nsamp-1), b(0), and b(1) estimate some confounded parameters (see paper cited above). If reduced models are fit, you should pay attention to some of the restrictions. E.g. if you fit a model where phi is equal over groups, then phi(nsamp-1) is not restricted because it is unlikely that phi(nsamp-1)*p(nsamp) is the same over all groups. Use a design matrix to fit simpler models or to fix parameters at some value. ZERO SUMMARY STATISTICS: It can happen by accident or design that certain summary statistics are zero. This can cause identifiability problems. The most common occurances and what to do are listed below: m(i)=0. m(i)>0. No marked animals captured in recapture sample. This could be a problem because the MLE for the population size could be infinite. However, the u(i) does provide some information about the true population size and in many cases the program does converge properly. If the program seems to be driving pent(i-1) to 1.000 then you need to constrain pent(i-1) to some value. n(i)=0, m(i)=0, R(i)=0, r(i)=0, z(i)>0 Usually caused by no samples taken at a particular sample time. Very common in age/cohort models where animals cannot be captured before released in a multiyear study. Refer to Age directory for example programs. phi(i-1)phi(i) can be estimated. Constrain phi(i)=1 and use phi(i-1) as the product. pent(i-1)+pent(i) can be estimated. Constrain pent(i)=0 and use pent(i-1) as the sum. p(i)=0. Constrain p(i)=0. z(i)=0, r(i)>0 Usually caused by poor sample sizes. Program should converge properly when restricting p(i)=1 using the design matrix.. z(i)=0, r(i)=0 Usually caused by poor sample sizes. Program should converge when restricting phi(i)=0, but this causes problems in estimating the gross births. !------------------- SAMPLE INPUT FILES showing various features !These files are available in the Example subdirectory ! !These can be run as is, all lines with the comment indicator (!) in column 1 are ignored. ! ! !Example: Grey Seals ! This has two groups (males and females) with 6 sample times. ! We will fit a model where ! p(i) equal over groups, but changes over time ! phi(i) equal over groups but changes over time ! births(i) change over time and groups. ! ! This will use the model keywords to fit the model ! Grey Seals Band.year = 1969.70 Sighting year=91. p(t), phi(t), b(g*t) - model keywords 2 6 notrace stat mod design noinit 1 8 0 8 8 0 Female summary statistics 2 43 5 43 30 3 3 65 28 65 45 5 4 72 44 72 39 6 5 60 44 60 6 1 6 10 7 10 0 0 1 49 0 49 44 0 Male summary statistics 2 75 28 75 59 16 3 58 42 58 49 33 4 75 56 75 51 26 5 80 67 79 25 10 6 39 35 39 0 0 t t g*t Note the way the model keywords are used 0 Note that 0 beta terms, but 1 column appears below to fix parameters 1 10 p(1) = 1 Note that you must know the internals to be able to fix this without using a PIM 6 10 p(6) = 1 0 0 0 0 0 0 0 end of design matrix specification !------------------------------------------------------------------- !Example: Grey Seals- same as above but using a PIM ! This has two groups (males and females) with 6 sample times. ! We will fit a model where ! p(i) equal over groups, but changes over time ! phi(i) equal over groups but changes over time ! births(i) change over time and groups. ! ! Note the use of non-consecutive PIM index elements, i.e. ! when you use PIM numbers, you can use any coding that is consistent with your model ! Grey Seals Band.year = 1969.70 Sighting year=91. p(t), phi(t), b(g*t) - PIM 2 6 notrace stat pim design noinit 1 8 0 8 8 0 Female summary statistics 2 43 5 43 30 3 3 65 28 65 45 5 4 72 44 72 39 6 5 60 44 60 6 1 6 10 7 10 0 0 1 49 0 49 44 0 Male summary statistics 2 75 28 75 59 16 3 58 42 58 49 33 4 75 56 75 51 26 5 80 67 79 25 10 6 39 35 39 0 0 ! 1 2 3 4 5 6 <- sample times 1 2 3 4 5 6 capture rates for group 1 vary over time 10 11 12 13 14 survival rates for group 1 vary over time 20 21 22 23 24 25 entrance probabilities for group 1 vary over time 1 2 3 4 5 6 capture rates for group 2 same as first group 10 11 12 13 14 survival rates for group 2 same as first group 30 31 32 33 34 35 entrance probabilities for group 2 differ from group 12 0 Note 0 beta terms specified, but one column appears below to fix parameters 1 10 p(1) = 1 6 10 p(6) = 1 0 0 0 0 0 0 0 end of design matrix specification !------------------------------------------------------------------- !Example: Grey Seals- same as above but using a mixture of PIM and DESIGN matrix ! This has two groups (males and females) with 6 sample times. ! We will fit a model where ! p(i) equal over groups, but changes over time ! phi(i) equal over groups but changes over time ! births(i) change over time and groups. ! ! The PIM matrix is used to constrain the capture prob between the two groups ! while the design matrix is used to constrain the survival prob between the two groups ! Grey Seals Band.year = 1969.70 Sighting year=91. p(t), phi(t), b(g*t) - PIM and design 2 6 notrace stat pim design noinit 1 8 0 8 8 0 Female summary statistics 2 43 5 43 30 3 3 65 28 65 45 5 4 72 44 72 39 6 5 60 44 60 6 1 6 10 7 10 0 0 1 49 0 49 44 0 Male summary statistics 2 75 28 75 59 16 3 58 42 58 49 33 4 75 56 75 51 26 5 80 67 79 25 10 6 39 35 39 0 0 ! 1 2 3 4 5 6 <- sample times 1 2 3 4 5 6 capture rates for group 1 vary over time 10 11 12 13 14 survival rates for group 1 vary over time 20 21 22 23 24 25 entrance probabilities for group 1 vary over time 1 2 3 4 5 6 capture rates for group 2 same as first group 15 16 17 18 19 survival rates for group 2 30 31 32 33 34 35 entrance probabilities for group 2 differ from group 12 5 There are 5 beta parameters 1 10 0 0 0 0 0 6 10 0 0 0 0 0 10 0 1 0 0 0 0 Group 1, phi 1 11 0 0 1 0 0 0 Group 1, phi 2 12 0 0 0 1 0 0 ... 13 0 0 0 0 1 0 14 0 0 0 0 0 1 15 0 1 0 0 0 0 Group 2, phi 1. Note same beta paramater as group1 phi 1 16 0 0 1 0 0 0 Group 2, phi 2 17 0 0 0 1 0 0 ... 18 0 0 0 0 1 0 19 0 0 0 0 0 1 0 0 0 0 0 0 0 end of design matrix specification !------------------------------------------------------------------- !Example: Coho salmon ! This has two groups (adults and jacks) with 8 sample times ! ! p(i) constant over time but changes among groups, ! phi(i) changes over time, but equal among groups ! birth(i) changes over time and among groups. ! ! This examples shows how to use trace flags, and a design matrix ! ! [This could also have been specified with the triplet g t g*t ! Other ways of fitting this model are found in the Examples/Chase directory] ! ! ! Chase89 Males and Jacks 1&2, 8&9 pooled - p(g), phi(t), b(g*t) 2 8 trace stat pim design noinit ( 2 groups, 8 sample times, trace flags, summary statist, no models, design, no initvals) tffffffffffffffffffffffffffff ( trace flags) 1.5 85 0 85 28 0 Adults sum stats 3 35 12 34 19 16 4 97 14 72 31 21 5 84 25 78 34 27 6 67 39 56 14 22 7 51 28 37 5 8 8.5 39 6 29 7 7 10 18 14 0 0 0 1.5 67 0 62 21 0 Jacks sum stats 3 28 9 25 7 12 4 46 6 44 9 13 5 47 12 45 5 10 6 25 9 24 3 6 7 16 6 12 1 3 8.5 7 1 5 1 3 10 7 4 0 0 0 ! 1 2 3 4 5 6 7 8 <- sample times 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 9 There are 9 beta parms 1 0 1 0 0 0 0 0 0 0 0 p(group1,1) 2 0 1 0 0 0 0 0 0 0 0 p(group1,2) is same a p(group1,1) 3 0 1 0 0 0 0 0 0 0 0 4 0 1 0 0 0 0 0 0 0 0 5 0 1 0 0 0 0 0 0 0 0 6 0 1 0 0 0 0 0 0 0 0 7 0 1 0 0 0 0 0 0 0 0 8 0 1 0 0 0 0 0 0 0 0 24 0 0 1 0 0 0 0 0 0 0 now constrain the group 2 p's to be all equal 25 0 0 1 0 0 0 0 0 0 0 26 0 0 1 0 0 0 0 0 0 0 27 0 0 1 0 0 0 0 0 0 0 28 0 0 1 0 0 0 0 0 0 0 29 0 0 1 0 0 0 0 0 0 0 30 0 0 1 0 0 0 0 0 0 0 31 0 0 1 0 0 0 0 0 0 0 9 0 0 0 1 0 0 0 0 0 0 phi(group1,1) 32 0 0 0 1 0 0 0 0 0 0 phi(group2,1) is the same as phi(group1,1) 10 0 0 0 0 1 0 0 0 0 0 33 0 0 0 0 1 0 0 0 0 0 11 0 0 0 0 0 1 0 0 0 0 34 0 0 0 0 0 1 0 0 0 0 12 0 0 0 0 0 0 1 0 0 0 35 0 0 0 0 0 0 1 0 0 0 13 0 0 0 0 0 0 0 1 0 0 36 0 0 0 0 0 0 0 1 0 0 14 0 0 0 0 0 0 0 0 1 0 37 0 0 0 0 0 0 0 0 1 0 15 0 0 0 0 0 0 0 0 0 1 38 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 end of design matrix specification !------------------------------------------------------------------- !Example: Age/Cohort model with constraints applied: ! Data taken from Evan Cooch's Surge Manual - 3 age classes. ! Refer to paper in Euring 97 proceedings for more details. ! ! This illustrates setting some parameters to constants using the design matrix ! and a joint use of PIM and design matrices ! ! Note that the constant term is specified on the LOGIT scale where -10 = 0, 10 = 1 Example for Euring - Three age classes 3 6 notrace stat pim design noinit 1 185 0 185 59 0 Juveniles released in yr 1 2 46 46 46 34 13 3 35 35 35 26 12 4 22 22 22 15 16 5 21 21 21 16 10 6 26 26 26 0 0 1 0 0 0 0 0 Juveniles released in yr 2 2 185 0 185 40 0 3 33 33 33 22 7 4 17 17 17 9 12 5 19 19 19 14 2 6 16 16 16 0 0 1 0 0 0 0 0 Juveniles released in yr 3 2 0 0 0 0 0 3 185 0 185 33 0 4 13 13 13 13 20 5 26 26 26 12 7 6 19 19 19 0 0 ! 1 2 3 4 5 6 <- sample times 1 2 3 4 5 6 Group 1 p's 7 8 8 8 8 group 1 phis are equal after age 2 onwards 12 13 13 13 13 13 group 1 pents 18 19 3 4 5 6 group 2 p's 24 25 26 26 26 group 2 phis are equal after age 2 12 13 13 13 13 13 group 2 pents 35 36 37 4 5 6 group 3 p's 24 24 43 44 44 group 3 phi's are equal after age 2 12 13 13 13 13 13 group 3 pents 0 There are 4 beta parameters 1 10 p ( group 1, 1) = 1 18 -10 p ( group 2, 1) is zero because of 0 sample size 19 10 p ( group 1, 2) = 1 24 10 phi( group 2, 1) is 1 because of 0 sample size 35 -10 p ( group 3, 1) is zero because of 0 sample size 36 -10 p ( group 3, 2) is zero because of 0 sample size 37 10 p ( group 1, 3) = 1 41 10 phi( group 3, 1) is 1 because of 0 sample size 42 10 phi( group 3, 2) is 1 because of 0 sample size 12 10 pent(*,1) = 1 13 -10 pent(8,rest) = 0 0 0 0 0 0 0 0 end of design matrix specification !------------------------------------------------------------------- !Example: European Dippers ! ! This example shows how to read in the capture histories instead of summary statistics, ! the specification of absolute sample times ! EUROPEAN DIPPER, MALES AND FEMALES 2 7 notrace hist mod design noinit 1 2 3 4 5 6 7 absolute sample times 1111110 1 0 histories must start in column 1 1111100 0 1 1111000 1 0 1111000 0 1 1101110 0 1 1100000 1 0 1100000 1 0 1100000 1 0 1100000 1 0 1100000 0 1 1100000 0 1 1010000 1 0 1010000 0 1 1000000 1 0 1000000 1 0 1000000 1 0 1000000 1 0 1000000 1 0 1000000 0 1 1000000 0 1 1000000 0 1 1000000 0 1 0111111 0 1 0111111 0 1 0111110 0 1 0111100 1 0 0111100 0 1 0111100 0 1 0111000 1 0 0111000 0 1 0110110 0 1 0110000 1 0 0110000 1 0 0110000 1 0 0110000 1 0 0110000 1 0 0110000 1 0 0110000 1 0 0110000 0 1 0110000 0 1 0110000 0 1 0110000 0 1 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 1 0 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0100000 0 1 0011111 0 1 0011111 0 1 0011110 1 0 0011110 0 1 0011100 1 0 0011100 1 0 0011100 1 0 0011100 1 0 0011100 0 1 0011100 0 1 0011000 1 0 0011000 1 0 0011000 1 0 0011000 1 0 0011000 1 0 0011000 1 0 0011000 1 0 0011000 1 0 0011000 0 1 0011000 0 1 0011000 0 1 0011000 0 1 0010110 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 1 0 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0010000 0 1 0001111 1 0 0001111 1 0 0001111 1 0 0001111 1 0 0001111 1 0 0001111 1 0 0001111 0 1 0001111 0 1 0001110 1 0 0001110 1 0 0001110 1 0 0001110 0 1 0001110 0 1 0001110 0 1 0001110 0 1 0001100 1 0 0001100 1 0 0001100 1 0 0001100 1 0 0001100 1 0 0001100 1 0 0001100 0 1 0001100 0 1 0001100 0 1 0001100 0 1 0001100 0 1 0001011 0 1 0001001 1 0 0001001 0 1 0001000 1 0 0001000 1 0 0001000 1 0 0001000 1 0 0001000 1 0 0001000 1 0 0001000 0 1 0001000 0 1 0001000 0 1 0001000 0 1 0001000 0 1 0001000 0 1 0001000 0 1 0001000 0 1 0001000 0 1 0001000 0 1 0000111 1 0 0000111 1 0 0000111 1 0 0000111 1 0 0000111 1 0 0000111 1 0 0000111 1 0 0000111 1 0 0000111 1 0 0000111 1 0 0000111 0 1 0000111 0 1 0000111 0 1 0000111 0 1 0000111 0 1 0000111 0 1 0000110 1 0 0000110 1 0 0000110 1 0 0000110 0 1 0000110 0 1 0000110 0 1 0000110 0 1 0000110 0 1 0000110 0 1 0000100 1 0 0000100 1 0 0000100 1 0 0000100 1 0 0000100 1 0 0000100 1 0 0000100 1 0 0000100 1 0 0000100 1 0 0000100 0 1 0000100 0 1 0000100 0 1 0000100 0 1 0000100 0 1 0000100 0 1 0000100 0 1 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 1 0 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000011 0 1 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 1 0 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000010 0 1 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 1 0 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000001 0 1 0000000 0 0 ****** Notice the 0000000 record to indicate the end of the histories ******* g*t g*t g*t 0 There are 0 beta terms 1 10 p(1,1) = 1 Because PIM not specified, you must know the internal PIM numbers 7 10 p(1,7) = 1 21 10 p(2,1) = 1 27 10 p(2,7) = 1 0 0 0 0 0 0 0 end of design matrix specification ---------------------------------------------------------------------------------------------------- Revision History 31 Aug 00 - implemented cycling, but this can be turned off with trace(11) fixed bug on reading initial values 10 July 00 - implemented full design matrix specifications dropped all user constraint coding (as this is superseded by design matrix method) added feature for comment lines in input deck adjustments per unit time for phi added. Trace(14) turns this off 28 Feb 00 - converted all source to f90 using a "simple" conversion program from the web 13 Jan 00 - added PIM. Cleaned up code for restrictions 6 Oct 99 - Checked and added code for AUC estimes, stream residence time etc Added code to allow user to specify initial values 15 June 99 - added code to compute the phi_0 in the age-specific breeding proportion models. 1 June 99 - added code to compute lambda estimates and to fit models where lambda is constrained to be equal across time values 1 Dec 98 - added code to compute gamma estimates of Pradel and their standard errors and to compute age specific breeding proportions and their standard errors. 25 May 97 - Fixed bug that prevented data with n(i)=0 from being fit. 19 June 96 - Bug fix to uncond and modres for nobirth models. 31 August 95 - Added the three code model selection replacing old method of specifying a single model number. Use the SVD decomposition to remove redundant constraints to avoid the singular matrix problem in general. 11 April 95 - Fixed a bug that gave a singular matrix when you specify a constraint that pent(j)=1. Routine modified was res_pent01. 3 April 95 - Added trace(16) flag for adjusting variances by conditioning on B. This would work if there are no constraints on the beta (excluding constraints at zero) but there doesn't seem to be any way of implementing the correction when there are constraints on betas (e.g., beta(2)=beta(3), etc). 28 January 95 - change all include pointers to Include library - change all print statements to write(6, ) statements 9 December 94 - README file created.