JAA - MIXED MODEL PROGRAM USING ITERATION ON DATA WITH SUPPORT FOR ANIMAL MODEL (Alternative name: MIXIT) Written by I. Misztal University of Illinois 1207 W. Gregory Dr. Urbana IL 61801 USA tel. (217) 244-3164 FAX: 244-2871 E-mail: ignacy@uiuc.edu, ignacy@uiucvmd.bitnet (last updated 7/2/93) Introduction JAA is a FORTRAN-77 program that provides solutions to a class of mixed models. Effects include fixed and random factors. One random factor can contain an animal relationship matrix with unidentified parent effects. The program does not create a coefficient matrix but iterates on data (1). Each iteration requires the data file to be read as many times as there are factors in the model. However, this file need not be sorted. The relationship file, if exists, is read only once per iteration, and also need not be sorted. To speed-up reading and writing from disk, the data files are rewritten to binary form at the beginning of iteration. Special subroutines (IOF,IOF1) access the data through large buffers, thus speeding I/O from 2 to 10 times over ordinary unformatted transfers. The program is self-contained and "mostly" machine independent. It runs on IBM PC (compiled by Microsoft optimizing fortran compiler ver. 4.0 to 5.0) and VS Fortran unchanged. Under VS Fortran on IBM mainframes the following applies: 1. It is recommended that the program be converted to upper case, to avoid problems in alphanumeric comparisons, 2. File opened in VS Fortran as XXX is viewed by the system as FILE XXX A, file opened as \A B C is viewed as A B C. 3. The parameter file FILE IAP A should be converted to fixed record length. Attention: Use JAA and derivatives should be acknowledged in publications. Files Both data and relationship files are read in integer free-format. Positions of factors and traits in the data file are not restricted, however, each factor should be numbered consecutively, starting from 1. The relationship file, if exists, should cover all animals, and has the following structure: animal no. dam no. sire no. type of contribution If sire or dam are not known, they are replaced by unknown parent groups (4, 5), that could be based on estimated date of birth of the unknown parent. Type of contribution is 3, 2, or 1 depending whether no parent is identified (both parents replaced by respective groups), one parent identified, and both parents identified, respectively. The unknown parent groups should be included in the animal effect and be numbered consecutively right after the last animal. The groups are not included as animals in the relationship file. Parameters Parameters can be entered either interactively or through a parameter file. The parameter file contains exactly the same lines which are entered interactively. Note that a factor with a variance ratio multiplied by -1 is treated as an animal factor. Convergence Animal models are known to converge slowly. Over 100 rounds should usually be done for an acceptable level of convergence. Relaxation factor, which affects the convergence significantly, should be in the range of .75-.88 with a relationship matrix, and 0-.3 without. For more information see (2, 3). Comments JAA has been modified in endless ways. A different version, JAA20, supports regressions and calculates approximate reliability with the animal model. Caution Most problems with JAA result from incorrect coding of data. Consider coding using the program RENUM. In case of trouble please make sure that: 1. No animal has code 0. Unknown animals are considered unknown parents. If no unknown parent groups are desired, code all unknown parents as the number for the highest animal + 1, and state the number of animals in the parameter files as the real number of animals, i.e., not considering the one unknown parent group. 2. Codes for levels should be between 1 and their maximum declared value. References 1. Misztal I. and D. Gianola. 1987. Indirect solution of mixed model equations. J. Dairy Sci. 70:716. 2. Misztal I., D. Gianola, and L. R. Schaeffer. 1987. Extrapolation and convergence criteria with Jacobi and Gauss-Seidel iteration in animal models. J. Dairy Sci. 70:2577. 3. Wiggans G. R. and I. Misztal. 1987. Supercomputer for animal model evaluations of Ayshire milk yield. J. Dairy Sci. 70:1906. 4. Wiggans G. R., I. Misztal, and L. D. Van Vleck. 1987. Animal model evaluation of Ayshire milk yield with all lactations, herd-sire interaction and groups based on unknown parents. J. Dairy Sci. 71:1319. 5. Westell R. A. 1984. Simultaneous genetic evaluation of sires and cows for a large population of dairy cattle. Ph.D. thesis, Cornell Univ., Ithaca, NY. 6. (papers in the Proceedings of the Animal Model Workshop, ADSA, 1988) 7. I. Misztal, D. Gianola and J.L. Foulley. 1989. Computing aspects of a nonlinear method of sire evaluation for categorical data. J. Dairy Sci. 72:1557. [ Contains descriptions of the iteration method of the program as well as working of the IOF subroutines] Example The model is: yield = h-y-s + herd-sire + perm.env. + animal + residual Design is as follows dam sire cow herd y-s yield --------------------------------- [1] 1 1 1 1 10 1 1 2 1 1 11 2 2 3 2 2 15 7 3 4 2 2 13 [1] 4 5 2 3 14 1 3 6 2 3 12 [2] [3] 7 - - - bull dam sire --------------- 1 5 4 2 [2] 1 3 7 [3] 4 [2] [3] Square brackets mean that the respective animals have not been identified and are replaced by unknown group effects. The data file (ic) is: 1 1 1 1 10 2 1 2 1 11 3 2 3 2 15 4 2 4 3 13 5 3 5 4 14 6 3 6 3 12 where subsequent columns denote effects of: cow, hys, permament enviroment, herd by sire interaction, and yield. The relationship file (is) is: 1 12 8 2 2 1 8 1 3 2 9 1 4 7 10 1 5 12 11 2 6 1 10 1 7 13 14 3 8 5 11 1 9 13 8 2 10 7 14 2 11 13 14 3 In the file above, sires were renumbered to 8-11 and group effects to 12-14. Below, variance ratios for animals, permanent enviroment effect, and herd by sire interaction are assumed to be 2, 10 and 20 respectively. Execution on IBM PC/AT >jaa name of a file with parameters, con - if console: con data name: ic name of file with animal relationships: is name of output file: pp no of factors, trait pos., rel. factor,iterations?: 4 5 .8 5 for each factor give position, no of levels, and variance ratio, 0 if fixed, multiply ratio by -1 for factor to which relationship matrix is applied 2 3 0 3 6 10 4 4 20 1 14 -2 iteration no. convergence criterion last solution 1 1.000000 0.000000E+00 2 1.135215E-04 0.000000E+00 3 1.573324E-04 -1.075020E-01 . 58 8.569472E-07 -4.411088 59 8.394298E-07 -4.433086 . 122 1.341061E-07 -5.317968 123 1.303058E-07 -5.326666 . 196 1.625908E-08 -5.723093 197 1.580785E-08 -5.726206 . 303 8.134370E-10 -5.897852 304 7.926634E-10 -5.898557 how many more iterations, 0-none? 0 solutions were stored in file sol Stop - Program terminated. > >type pp iteration no. convergence criterion last solution 1 1.000000 0.000000E+00 2 1.135215E-04 0.000000E+00 3 1.573324E-04 -1.075020E-01 4 1.654363E-04 -3.614665E-01 5 1.545083E-04 -6.549853E-01 . . 300 8.843580E-10 -5.895678 301 8.589924E-10 -5.896413 302 8.344820E-10 -5.897138 303 8.134370E-10 -5.897852 304 7.926634E-10 -5.898557 6 records 27 equations solutions of factor 2 var. ratio 0.000000E+00 1: 11.4278 2: 13.3271 3: 14.2778 solutions of factor 3 var. ratio 10.000000 1: -.0088 2: .0088 3: -.0158 4: .0158 5: .0321 6: -.0321 solutions of factor 4 var. ratio 20.000000 1: .0000 2: -.0079 3: -.0081 4: .0161 solutions of factor 1 var. ratio -2.000000 1: -1.3312 2: -.5251 3: 1.8552 4: -.4930 5: -.6475 6: -1.9166 7: 1.2764 8: .2763 9: 4.3148 10: -2.3415 11: 1.2787 12: -2.7560 13: 8.4133 14: -5.8986 Example on IBM 3081 mainframe R; T=0.01/0.01 15:39:29 type file ic 1 1 1 1 10 2 1 2 1 11 3 2 3 2 15 4 2 4 3 13 5 3 5 4 14 6 3 6 3 12 R; T=0.01/0.01 15:39:46 type file is 1 12 8 2 2 1 8 1 3 2 9 1 4 7 10 1 5 12 11 2 6 1 10 1 7 13 14 3 8 5 11 1 9 13 8 2 10 7 14 2 11 13 14 3 R; T=0.01/0.01 15:39:56 type file iap IC IS PP 4 5 .8 5 2 3 0 3 6 10 4 4 20 1 14 -2 R; T=0.01/0.01 15:40:05 load jaa R; T=0.04/0.08 15:40:13 start EXECUTION BEGINS... NAME OF A FILE WITH PARAMETERS, CON - IF CONSOLE: iap ITERATION NO. CONVERGENCE CRITERION LAST SOLUTION 1 1.00000000 0.000000000E+00 2 0.113520393E-03 0.000000000E+00 3 0.157333168E-03 -0.107501984 4 0.165435675E-03 -0.361464024 HOW MANY MORE ITERATIONS, 0-NONE? ? 6 5 0.154509180E-03 -0.654978335 6 0.163371951E-03 -0.932291865 7 0.108643289E-03 -1.22511768 8 0.881470769E-04 -1.52467155 9 0.319161336E-04 -1.80110455 10 0.374963274E-04 -2.06527996 HOW MANY MORE ITERATIONS, 0-NONE? ? 0 SOLUTIONS WERE STORED IN FILE SOL R; T=0.23/0.36 15:40:34 type pp INCOMPLETE FILEID SPECIFIED. R(00024); T=0.01/0.01 15:40:45 type file pp ITERATION NO. CONVERGENCE CRITERION LAST SOLUTION 1 1.00000000 0.000000000E+00 2 0.113520393E-03 0.000000000E+00 3 0.157333168E-03 -0.107501984 4 0.165435675E-03 -0.361464024 5 0.154509180E-03 -0.654978335 6 0.163371951E-03 -0.932291865 7 0.108643289E-03 -1.22511768 8 0.881470769E-04 -1.52467155 9 0.319161336E-04 -1.80110455 10 0.374963274E-04 -2.06527996 6 RECORDS 27 EQUATIONS SOLUTIONS OF FACTOR 2 VAR. RATIO 0.000000000E+00 1: 10.1016 2: 14.0845 3: 13.0235 SOLUTIONS OF FACTOR 3 VAR. RATIO 10.0000000 1: -0.0451 2: 0.0451 3: 0.0231 4: -0.0231 5: 0.0401 6: -0.0401 SOLUTIONS OF FACTOR 4 VAR. RATIO 20.0000000 1: 0.0000 2: 0.0116 3: -0.0319 4: 0.0202 SOLUTIONS OF FACTOR 1 VAR. RATIO -2.00000000 1: 0.4230 2: 0.4003 3: 0.6935 4: -0.8138 5: 0.5598 6: -0.5616 7: -0.3611 8: 0.1767 9: 0.8670 10: -1.2974 11: -0.2809 12: 1.0700 13: 1.3896 14: -2.0653 R; T=0.01/0.05 15:41:00 type file sol 10.1016 14.0845 13.0235 -0.0451 0.0451 0.0231 -0.0231 0.0401 -0.0401 0.0000 0.0116 -0.0319 0.0202 0.4230 0.4003 0.6935 -0.8138 0.5598 -0.5616 -0.3611 0.1767 0.8670 -1.2974 -0.2809 1.0700 1.3896 -2.0653 R; T=0.01/0.03 15:41:23