GRM/GIV - General (Inverse) Relationship Matrix

Function

For the more general situation where the pedigree based (inverse) relationship matrix is not the appropriate/required matrix, the user can provide a particular general (inverse) variance ( GIV or GRM ) matrix explicitly in a .giv (.grm) file.

The user can prepare a .giv file containing this matrix and use it in the analysis. Alternatively, the user can prepare the relationship matrix in a .grm file and ASReml will invert it to form the GIV matrix.

The syntax for specifying a G matrix file (say name.grm) or the G inverse file (say name.giv) is
name.grm [ !SKIP n ] [ !DENSEGRM [ o] ] [ !GROUP n ] [ !ND | !PSD | !NSD ] [ !PRECISION e ] [ !SAVEGIV f ] or
name.giv [ !SKIP n ] [ !DENSEGIV [ o] ] [ !GROUP n ] [ !SAVEGIV f ]

  • the named file must have a .giv or .grm extension,
  • the G (inverse) files must be specified on the line(s) immediately prior to the data file line after any pedigree file,
  • up to 98 G (inverse) matrices may be defined,
  • the file must be in SPARSE format unless the !DENSE qualifier is specified,
  • a dense format file has the whole matrix presented lower triangle rowwise, with each row beginning on a new line (rows may be split over several lines),
  • a sparse format file must be free format with three numbers per line, namely row column value defining the lower triangle row-wise of the matrix,
  • the file must be sorted column within row,
  • every diagonal element must be represented; missing off-diagonal elements are assumed to be zero cells,
      1  1 1
      2  2 1
      3  3 1
      4  4 1
      5  5  1.0666667
      6  5 -0.2666667
      6  6  1.0666667
      7  7  1.0666667
      8  7 -0.2666667
      8  8  1.0666667
      9  9  1.0666667
     10  9 -0.2666667
     10 10  1.0666667
     11 11  1.0666667
     12 11 -0.2666667
     12 12  1.0666667
    

    The .giv file presented above gives the following G inverse matrix
    1 0 0 0 0 0 0 0 0 0 0 0
    0 1 0 0 0 0 0 0 0 0 0 0
    0 0 1 0 0 0 0 0 0 0 0 0
    0 0 0 1 0 0 0 0 0 0 0 0
    0 0 0 0 1.067 -.267 0 0 0 0 0 0
    0 0 0 0 -.267 1.067 0 0 0 0 0 0
    0 0 0 0 0 0 1.067 -.267 0 0 0 0
    0 0 0 0 0 0 -.267 1.067 0 0 0 0
    0 0 0 0 0 0 0 0 1.067 -.267 0 0
    0 0 0 0 0 0 0 0 -.267 1.067 0 0
    0 0 0 0 0 0 0 0 0 0 1.067 -.267
    0 0 0 0 0 0 0 0 0 0 -.267 1.067
  • the !SKIP n qualifier tells ASReml to skip n header lines in the file.
  • !GROUP n allows adjustment of degrees of freedom when the GIV matrix incorporates fixed effects.
  • !PRECISION e allows adjusts the criterion for flagging a singularity when inverting the GRM.
    For 0 < e < 4, precision is exp(-7+e);
    For 3 < e < 7, precision is exp(-e);
  • !SAVEGIV n

    n=3 saves the inverse in single precision to an .sgiv file
    n=4 saves file in double precison .dgiv file

    Positive and Negative Semidefinite matrices

    If the file has a .grm file extension, ASReml will invert it. If it is not Positive Definite, the job will abort unless an appropriate qualifier !ND, !PSD or !NSD is supplied.
  • !ND ( !NSD) allows the matrix to be Negative (Semi)Definite.
  • !PSD allows the matrix to be Positive SemiDefinite. If the matrix is Negative (Semi)Definite, the iteration sequence may fail as some parameter values will generate 'Negative Residual Sum of Squares'. If SemiDefinite is permitted and the matrix is singular, ASReml forms an expanded 'Singular' representation of the inverse which allows the REML algorithm to proceeds. The effects for the extra equations have no natural interpretation.

    Using the GIV matrix

    The GIV matrix is used by associating it with a factor in the model. The number and order of the rows must agree with the size and order of the associated factor.

    The .giv/.grm matrix can be associated with a factor in two ways:
  • for a one-dimensional structure with the scale parameter
    Functional specification:
     grm1(animal 0.12)
    
    Structural specification:
      ... !r animal ...
      ...
     animal 1
     animal 0 GIV1 0.12
    
    or more simply
      ... !r giv(animal,1) 0.12 ...
    
  • for a two-dimensional structure with initial values: Functional specification:
     coruh(site 0.5 8*1.5).grm1(variety)
    
    Structural specification:
      ... !r site.variety ...
      ...
     site.variety 2
     site 0 CORUH 0.5
     8*1.5
     variety 0 GIV1
    

    Note: In the functional specification, givk() and grmk() are equivalent.

    The !GROUP qualifier

    A !GROUP n qualifier has been added to the GIV matrix specification line to allow for adjustment of any fixed degrees of freedom incorporated into the GIV matrix. This enables a GIV matrix generated using a pedigree with the !GROUPS qualifier to be used again as a GIV matrix. The value of the argument is the number of degrees of freedom fitted by the GIV matrix which will normally be the number of groups. When groups are constrained, then it will be the number of groups less number of constraints. For example, if the pedigree file qualified by !GROUPS 7 begins
     A 0 0
     B 0 0
     C 0 0
     ABC 0 0  # ABC is not present in the subsequent pedigree lines
     D 0 0
     E 0 0
     DE 0 0  # DE is not present in the subsequent pedigree lines
    
    there are actually only 5 genetic groups and two constraints so that the fixed effects for A, B and C sum to zero, and for D and E sum to zero leaving only 3 fixed degrees of freedom fitted. Therefore if the A inverse for this pedigree was saved, and subsequently used as a GIV matrix, it should be declared as !GROUPDF 3.

    Return to index